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



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

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