diff --git a/lib/webrat/rack.rb b/lib/webrat/rack.rb index cb6789a..49bbfca 100644 --- a/lib/webrat/rack.rb +++ b/lib/webrat/rack.rb @@ -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: diff --git a/spec/integration/rack/test/webrat_rack_test.rb b/spec/integration/rack/test/webrat_rack_test.rb index 8d7fbdb..4fdef09 100644 --- a/spec/integration/rack/test/webrat_rack_test.rb +++ b/spec/integration/rack/test/webrat_rack_test.rb @@ -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 "/"