Fix wrong HTTP_HOST in rack session

Webrat relies on www.example.com while Rack::Test expects example.org
This commit is contained in:
Simon Rozet 2009-06-24 15:19:06 +02:00
parent 92ec1c3d92
commit 8cda77318c
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,7 @@
require "rack/test"
Rack::Test::DEFAULT_HOST.replace("www.example.com")
module Webrat
class RackSession < Session
def initialize(rack_test_session) #:nodoc:

View File

@ -17,10 +17,10 @@ class WebratRackTest < Test::Unit::TestCase
assert_equal "/", last_request.env["PATH_INFO"]
end
# def test_redirects
# visit "/redirect_absolute_url"
# assert_equal "spam", response_body
# end
def test_redirects
visit "/redirect_absolute_url"
assert_equal "spam", response_body
end
def test_assertions_after_visit
visit "/"