Sha256: 1bd0be42e457e256a69e1aa0a19a795110b0aebfdfac8b32105a8291dca38b49

Contents?: true

Size: 364 Bytes

Versions: 117

Compression:

Stored size: 364 Bytes

Contents

module AuthenticatedTestHelper
  # Sets the current user in the session from the user fixtures.
  def login_as(user)
    @request.session[:user_id] = user ? users(user).id : nil
  end

  def authorize_as(user)
    @request.env["HTTP_AUTHORIZATION"] = user ? ActionController::HttpAuthentication::Basic.encode_credentials(users(user).login, 'test') : nil
  end
end

Version data entries

117 entries across 117 versions & 5 rubygems

Version Path
refinerycms-0.9.8.9 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.8.8 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.8.7 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.8.6 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.15 vendor/plugins/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.14 vendor/plugins/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.8.5 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.8.4 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.8.3 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.8.2 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.8.1 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.8 vendor/refinerycms/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.13 vendor/plugins/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.11 vendor/plugins/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.10 vendor/plugins/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.9 vendor/plugins/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.8 vendor/plugins/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.7 vendor/plugins/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.6 vendor/plugins/authentication/lib/authenticated_test_helper.rb
refinerycms-0.9.7.5 vendor/plugins/authentication/lib/authenticated_test_helper.rb