Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use spree_core AuthorizationHelper instead of local copy #34

Closed
wants to merge 1 commit into from

2 participants

@iloveitaly

Cleans up the testing code a bit.

@radar radar closed this in 5b10007
@iloveitaly iloveitaly deleted the iloveitaly:improved-testing branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 34 deletions.
  1. +1 −1  spec/spec_helper.rb
  2. +0 −33 spec/support/authorization_helpers.rb
View
2  spec/spec_helper.rb
@@ -7,8 +7,8 @@
#include spree's factories
require 'spree/core/testing_support/factories'
require 'spree/core/testing_support/controller_requests'
+require 'spree/core/testing_support/authorization_helpers'
require 'spree/core/url_helpers'
-# require 'spree/core/testing_support/authorization_helpers'
# include local factories
Dir["#{File.dirname(__FILE__)}/factories/**/*.rb"].each do |f|
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
Something went wrong with that request. Please try again.