Sha256: c3c5360380cb9192e1a182423d872b001087c37b052cc01d763d668a423fc936

Contents?: true

Size: 434 Bytes

Versions: 100

Compression:

Stored size: 434 Bytes

Contents

module Spree
  module Api
    module TestingSupport
      module Setup
        def sign_in_as_admin!
          let!(:current_api_user) do
            user = stub_model(Spree.user_class)
            allow(user).to receive_message_chain(:spree_roles, :pluck).and_return(['admin'])
            allow(user).to receive(:has_spree_role?).with('admin').and_return(true)
            user
          end
        end
      end
    end
  end
end

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
spree_api-4.0.9 lib/spree/api/testing_support/setup.rb
spree_api-4.1.15 lib/spree/api/testing_support/setup.rb
spree_api-4.2.7 lib/spree/api/testing_support/setup.rb
spree_api-4.3.3 lib/spree/api/testing_support/setup.rb
spree_api-4.4.1 lib/spree/api/testing_support/setup.rb
spree_api-4.2.6 lib/spree/api/testing_support/setup.rb
spree_api-4.3.2 lib/spree/api/testing_support/setup.rb
spree_api-4.4.0 lib/spree/api/testing_support/setup.rb
spree_api-4.4.0.rc2 lib/spree/api/testing_support/setup.rb
spree_api-4.3.1 lib/spree/api/testing_support/setup.rb
spree_api-4.4.0.rc1 lib/spree/api/testing_support/setup.rb
spree_api-4.3.0 lib/spree/api/testing_support/setup.rb
spree_api-4.3.0.rc3 lib/spree/api/testing_support/setup.rb
spree_api-4.3.0.rc2 lib/spree/api/testing_support/setup.rb
spree_api-4.3.0.rc1 lib/spree/api/testing_support/setup.rb
spree_api-4.2.5 lib/spree/api/testing_support/setup.rb
spree_api-4.1.14 lib/spree/api/testing_support/setup.rb
spree_api-4.0.8 lib/spree/api/testing_support/setup.rb
spree_api-4.2.4 lib/spree/api/testing_support/setup.rb
spree_api-3.7.14.1 lib/spree/api/testing_support/setup.rb