Class | Rack::Test::Session |
In: |
lib/rack/test.rb
|
Parent: | Object |
This class represents a series of requests issued to a Rack app, sharing a single cookie jar
Rack::Test::Session‘s methods are most often called through Rack::Test::Methods, which will automatically build a session when it‘s first used.
Creates a Rack::Test::Session for a given Rack app or Rack::MockSession.
Note: Generally, you won‘t need to initialize a Rack::Test::Session directly. Instead, you should include Rack::Test::Methods into your testing context. (See README.rdoc for an example)
Set the username and password for HTTP Basic authorization, to be included in subsequent requests in the HTTP_AUTHORIZATION header.
Example:
basic_authorize "bryan", "secret"
Set the username and password for HTTP Digest authorization, to be included in subsequent requests in the HTTP_AUTHORIZATION header.
Example:
digest_authorize "bryan", "secret"
Rack::Test will not follow any redirects automatically. This method will follow the redirect returned (including setting the Referer header on the new request) in the last response. If the last response was not a redirect, an error will be raised.