From 19723db7bc926520619d0862c35944fe6579659c Mon Sep 17 00:00:00 2001 From: Paul Richter Date: Thu, 18 Sep 2014 13:54:03 -0400 Subject: [PATCH 1/4] Changing order.token to order.guest_token in accordance with the name change in spree 2.3. --- lib/spree/permissions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spree/permissions.rb b/lib/spree/permissions.rb index 65ed535..2d67c4e 100644 --- a/lib/spree/permissions.rb +++ b/lib/spree/permissions.rb @@ -23,7 +23,7 @@ def method_missing(name, *args, &block) end current_ability.can [:read, :update], Spree::Order do |order, token| - order.user == user || (order.token && token == order.token) + order.user == user || (order.guest_token && token == order.guest_token) end current_ability.can :create, Spree::Order From b32955ee0cab5e6a217cc100886f063eac0dbce4 Mon Sep 17 00:00:00 2001 From: Paul Richter Date: Thu, 18 Sep 2014 16:23:41 -0400 Subject: [PATCH 2/4] Adding updated spec test --- spec/models/spree/ability_decorator_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/spree/ability_decorator_spec.rb b/spec/models/spree/ability_decorator_spec.rb index 02e1797..93d318f 100644 --- a/spec/models/spree/ability_decorator_spec.rb +++ b/spec/models/spree/ability_decorator_spec.rb @@ -273,8 +273,8 @@ end context 'requested with inproper token' do - let(:token) { 'FAIL' } - before(:each) { resource.stub :token => 'TOKEN123' } + let(:guest_token) { 'FAIL' } + before(:each) { resource.stub :guest_token => 'TOKEN123' } it_should_behave_like 'create only' end end From aa6c54d40fda5b61f2dbadd69beae098709c3690 Mon Sep 17 00:00:00 2001 From: Paul Richter Date: Thu, 18 Sep 2014 18:34:07 -0400 Subject: [PATCH 3/4] Adding updated gemfile and gemspec. This was required so that I could test properly. --- Gemfile | 13 +++++++++---- spree_admin_roles_and_access.gemspec | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 5e0cd5e..e0212e6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,22 +1,27 @@ source 'https://rubygems.org' -gem 'rails', '4.0.3' +gem 'rails', '4.1.2' gem 'mysql2' + +gem 'sass-rails' +gem 'sass' + # Gems used only for assets and not required # in production environments by default. group :test do + gem 'minitest' gem 'simplecov' - gem 'rspec-rails', '~> 2.12.0' + gem 'rspec-rails', '~> 2.14.0' gem 'coffee-script' gem 'shoulda-matchers', '~> 2.2.0' gem 'database_cleaner', '1.2.0' end -gem 'spree', '2.2.0' +gem 'spree', '2.3.0' # Provides basic authentication functionality for testing parts of your engine -gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-2-stable' +gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-3-stable' gemspec diff --git a/spree_admin_roles_and_access.gemspec b/spree_admin_roles_and_access.gemspec index 5e82ade..41c74b8 100644 --- a/spree_admin_roles_and_access.gemspec +++ b/spree_admin_roles_and_access.gemspec @@ -14,5 +14,5 @@ Gem::Specification.new do |s| s.require_path = 'lib' s.requirements << 'none' - s.add_dependency 'spree_core', '~> 2.2' + s.add_dependency 'spree_core', '~> 2.3' end From af7e8f850a8ab878ee15ee240b9c5768a97f897d Mon Sep 17 00:00:00 2001 From: Paul Richter Date: Fri, 19 Sep 2014 15:47:30 -0400 Subject: [PATCH 4/4] Hopefully this fixes annoying Travis build issue. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index e0212e6..5a4a762 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gem 'rails', '4.1.2' gem 'mysql2' gem 'sass-rails' -gem 'sass' +# gem 'sass' # Gems used only for assets and not required # in production environments by default.