Sha256: 2fa3c46054a656601219c8498e8a50efdb7e29122a359c40905577ae427d8afd

Contents?: true

Size: 697 Bytes

Versions: 16

Compression:

Stored size: 697 Bytes

Contents

module Workarea
  module Api
    module Storefront
      module AuthenticationTest
        extend ActiveSupport::Concern

        included do
          delegate :encode_credentials, to: ActionController::HttpAuthentication::Token
        end

        def set_current_user(user)
          Workarea::Api::Storefront::ApplicationController.subclasses.each do |klass|
            if klass.method_defined?(:current_user)
              klass.any_instance.stubs(:current_user).returns(user)
            end

            if klass.method_defined?(:authentication?)
              klass.any_instance.stubs(:authentication?).returns(true)
            end
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
workarea-api-4.5.6 storefront/test/support/authentication_test.rb
workarea-api-storefront-4.5.6 test/support/authentication_test.rb
workarea-api-4.5.5 storefront/test/support/authentication_test.rb
workarea-api-storefront-4.5.5 test/support/authentication_test.rb
workarea-api-4.5.4 storefront/test/support/authentication_test.rb
workarea-api-storefront-4.5.4 test/support/authentication_test.rb
workarea-api-4.5.3 storefront/test/support/authentication_test.rb
workarea-api-storefront-4.5.3 test/support/authentication_test.rb
workarea-api-4.5.2 storefront/test/support/authentication_test.rb
workarea-api-storefront-4.5.2 test/support/authentication_test.rb
workarea-api-4.5.0 storefront/test/support/authentication_test.rb
workarea-api-storefront-4.5.0 test/support/authentication_test.rb
workarea-api-4.4.7 storefront/test/support/authentication_test.rb
workarea-api-storefront-4.4.7 test/support/authentication_test.rb
workarea-api-4.4.6 storefront/test/support/authentication_test.rb
workarea-api-storefront-4.4.6 test/support/authentication_test.rb