Fix wrong HTTP_HOST in rack session
Webrat relies on www.example.com while Rack::Test expects example.org
This commit is contained in:
parent
92ec1c3d92
commit
8cda77318c
|
@ -1,5 +1,7 @@
|
||||||
require "rack/test"
|
require "rack/test"
|
||||||
|
|
||||||
|
Rack::Test::DEFAULT_HOST.replace("www.example.com")
|
||||||
|
|
||||||
module Webrat
|
module Webrat
|
||||||
class RackSession < Session
|
class RackSession < Session
|
||||||
def initialize(rack_test_session) #:nodoc:
|
def initialize(rack_test_session) #:nodoc:
|
||||||
|
|
|
@ -17,10 +17,10 @@ class WebratRackTest < Test::Unit::TestCase
|
||||||
assert_equal "/", last_request.env["PATH_INFO"]
|
assert_equal "/", last_request.env["PATH_INFO"]
|
||||||
end
|
end
|
||||||
|
|
||||||
# def test_redirects
|
def test_redirects
|
||||||
# visit "/redirect_absolute_url"
|
visit "/redirect_absolute_url"
|
||||||
# assert_equal "spam", response_body
|
assert_equal "spam", response_body
|
||||||
# end
|
end
|
||||||
|
|
||||||
def test_assertions_after_visit
|
def test_assertions_after_visit
|
||||||
visit "/"
|
visit "/"
|
||||||
|
|
Loading…
Reference in New Issue