| Path: | README.rdoc |
| Last Update: | Fri Mar 19 01:05:03 -0600 2010 |
Rack::Test is a small, simple testing API for Rack apps. It can be used on its own or as a reusable starting point for Web frameworks and testing libraries to build on. Most of its initial functionality is an extraction of Merb 1.0‘s request helpers feature.
require "rack/test"
class HomepageTest < Test::Unit::TestCase
include Rack::Test::Methods
def app
MyApp.new
end
def test_redirect_logged_in_users_to_dashboard
authorize "bryan", "secret"
get "/"
follow_redirect!
assert_equal "http://example.org/redirected", last_request.url
assert last_response.ok?
end
end
To install the latest release as a gem:
sudo gem install rack-test
Copyright (c) 2008-2009 Bryan Helmkamp, Engine Yard Inc. See MIT-LICENSE.txt in this directory.