Updating to leverage latest rack-test
This commit is contained in:
parent
f2882ef8b2
commit
11996a15dc
@ -1,7 +1,5 @@
|
||||
require "rack/test"
|
||||
|
||||
Rack::Test::DEFAULT_HOST.replace("www.example.com")
|
||||
|
||||
module Webrat
|
||||
class RackSession
|
||||
extend Forwardable
|
||||
|
@ -5,7 +5,7 @@ module Webrat
|
||||
def initialize(context)
|
||||
app = context.respond_to?(:app) ? context.app : Sinatra::Application
|
||||
|
||||
super(Rack::Test::Session.new(app))
|
||||
super(Rack::Test::Session.new(Rack::MockSession.new(app, "www.example.com")))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,6 +6,10 @@ class WebratRackTest < Test::Unit::TestCase
|
||||
include Webrat::Matchers
|
||||
include Webrat::HaveTagMatcher
|
||||
|
||||
def build_rack_mock_session
|
||||
Rack::MockSession.new(app, "www.example.com")
|
||||
end
|
||||
|
||||
def test_visits_pages
|
||||
visit "/"
|
||||
click_link "there"
|
||||
@ -46,7 +50,7 @@ end
|
||||
|
||||
class WebratRackSetupTest < Test::Unit::TestCase
|
||||
def test_usable_without_mixin
|
||||
rack_test_session = Rack::Test::Session.new(app)
|
||||
rack_test_session = Rack::Test::Session.new(Rack::MockSession.new(app))
|
||||
adapter = Webrat::RackSession.new(rack_test_session)
|
||||
session = Webrat::Session.new(adapter)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user