Module: Spree::TestingSupport::AuthorizationHelpers::Controller

Includes:
CustomAbility
Defined in:
lib/spree/testing_support/authorization_helpers.rb

Instance Method Summary collapse

Methods included from CustomAbility

#build_ability

Instance Method Details

#stub_authorization!(&block) ⇒ Object



17
18
19
20
21
22
# File 'lib/spree/testing_support/authorization_helpers.rb', line 17

def stub_authorization!(&block)
  ability_class = build_ability(&block)
  before do
    allow(controller).to receive(:current_ability).and_return(ability_class.new(nil))
  end
end