Sha256: 53c68f8ad002cfef2d1dc53a683ab633a1971c1ad6033551b3348a85c3a092af

Contents?: true

Size: 369 Bytes

Versions: 31

Compression:

Stored size: 369 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, 'monkey') : nil
  end
  
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
simonmenke-mr_authentication-0.0.1 lib/authenticated_test_helper.rb
tournament-5.0.0 webgui/lib/authenticated_test_helper.rb
tournament-4.2.0 webgui/lib/authenticated_test_helper.rb
tournament-4.0.2 webgui/lib/authenticated_test_helper.rb
tournament-4.0.0 webgui/lib/authenticated_test_helper.rb
tournament-3.3.3 webgui/lib/authenticated_test_helper.rb
tournament-3.3.2 webgui/lib/authenticated_test_helper.rb
tournament-3.3.1 webgui/lib/authenticated_test_helper.rb
tournament-3.3.0 webgui/lib/authenticated_test_helper.rb
tournament-3.2.2 webgui/lib/authenticated_test_helper.rb
tournament-3.2.1 webgui/lib/authenticated_test_helper.rb
tournament-3.2.0 webgui/lib/authenticated_test_helper.rb
tournament-3.1.1 webgui/lib/authenticated_test_helper.rb
tournament-3.1.0 webgui/lib/authenticated_test_helper.rb
tournament-3.0.3 webgui/lib/authenticated_test_helper.rb
tournament-3.0.2 webgui/lib/authenticated_test_helper.rb
tournament-3.0.1 webgui/lib/authenticated_test_helper.rb
tournament-3.0.0 webgui/lib/authenticated_test_helper.rb
tournament-2.2.0 webgui/lib/authenticated_test_helper.rb
tournament-2.2.1 webgui/lib/authenticated_test_helper.rb