Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use spree core AuthorizationHelper instead of local copy

Fixes #34
  • Loading branch information...
commit 5b100077b3705d9aba36a128ceeb9066b65510ef 1 parent 98bf698
@iloveitaly iloveitaly authored radar committed
Showing with 1 addition and 33 deletions.
  1. +1 −0  spec/spec_helper.rb
  2. +0 −33 spec/support/authorization_helpers.rb
View
1  spec/spec_helper.rb
@@ -22,6 +22,7 @@
# Uncomment when 1.2.1 is released
# require 'spree/core/testing_support/authorization_helpers'
require 'spree/core/testing_support/controller_requests'
+require 'spree/core/testing_support/authorization_helpers'
require 'spree/core/url_helpers'
# include local factories
View
33 spec/support/authorization_helpers.rb
@@ -1,33 +0,0 @@
-# copy of this helper until 1.2.1
-# https://github.com/spree/spree/commit/61d1aafa78bc278efe041c7b50a3202e831d0208
-
-module AuthorizationHelpers
- module Controller
- def stub_authorization!
- before do
- controller.should_receive(:authorize!).twice.and_return(true)
- end
- end
- end
-
- module Request
- class SuperAbility
- include CanCan::Ability
-
- def initialize(user)
- # allow anyone to perform index on Order
- can :manage, :all
- end
- end
-
- def stub_authorization!
- before(:all) { Spree::Ability.register_ability(AuthorizationHelpers::Request::SuperAbility) }
- after(:all) { Spree::Ability.remove_ability(AuthorizationHelpers::Request::SuperAbility) }
- end
- end
-end
-
-RSpec.configure do |config|
- config.extend AuthorizationHelpers::Controller, :type => :controller
- config.extend AuthorizationHelpers::Request, :type => :request
-end
Please sign in to comment.
Something went wrong with that request. Please try again.