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



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

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