Module: AuthorizationHelpers::Controller

Defined in:
lib/spree/core/testing_support/authorization_helpers.rb

Instance Method Summary collapse

Instance Method Details

#stub_authorization!Object



3
4
5
6
7
8
9
10
# File 'lib/spree/core/testing_support/authorization_helpers.rb', line 3

def stub_authorization!
  let(:ability_user) { stub_model(Spree::LegacyUser) }

  before do
    controller.stub(:authorize! => true)
    controller.stub(:try_spree_current_user => ability_user)
  end
end