Sha256: 55a07eb7aa8d35ed5766f2671b436a6783abff26294c811ce4e1caa9e1f22f6e

Contents?: true

Size: 435 Bytes

Versions: 38

Compression:

Stored size: 435 Bytes

Contents

module Spree
  module Api
    module TestingSupport
      module Setup
        def sign_in_as_admin!
          let!(:current_api_user) do
            user = stub_model(Spree::LegacyUser)
            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

38 entries across 38 versions & 2 rubygems

Version Path
solidus_api-1.0.7 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.6 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.5 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.4 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.3 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.2 lib/spree/api/testing_support/setup.rb
spree_api-2.4.10 lib/spree/api/testing_support/setup.rb
spree_api-2.3.13 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.1 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.0 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.0.rc2 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.0.rc1 lib/spree/api/testing_support/setup.rb
spree_api-2.4.9 lib/spree/api/testing_support/setup.rb
spree_api-2.3.12 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.0.pre3 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.0.pre2 lib/spree/api/testing_support/setup.rb
spree_api-2.4.8 lib/spree/api/testing_support/setup.rb
spree_api-2.3.11 lib/spree/api/testing_support/setup.rb
solidus_api-1.0.0.pre lib/spree/api/testing_support/setup.rb
spree_api-2.4.7 lib/spree/api/testing_support/setup.rb