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