diff --git a/spec/integration/rack/test/helper.rb b/spec/integration/rack/test/helper.rb index 7284dcf..e1ae2f0 100644 --- a/spec/integration/rack/test/helper.rb +++ b/spec/integration/rack/test/helper.rb @@ -11,11 +11,6 @@ Webrat.configure do |config| end class Test::Unit::TestCase - include Rack::Test::Methods - include Webrat::Methods - include Webrat::Matchers - include Webrat::HaveTagMatcher - def app Rack::Builder.new { use Rack::Lint diff --git a/spec/integration/rack/test/webrat_rack_test.rb b/spec/integration/rack/test/webrat_rack_test.rb index a2e2700..e3d760d 100644 --- a/spec/integration/rack/test/webrat_rack_test.rb +++ b/spec/integration/rack/test/webrat_rack_test.rb @@ -1,6 +1,11 @@ require File.dirname(__FILE__) + "/helper" class WebratRackTest < Test::Unit::TestCase + include Rack::Test::Methods + include Webrat::Methods + include Webrat::Matchers + include Webrat::HaveTagMatcher + def test_visits_pages visit "/" click_link "there" @@ -38,3 +43,16 @@ class WebratRackTest < Test::Unit::TestCase assert_contain "spam" end end + +class WebratRackSetupTest < Test::Unit::TestCase + def test_usable_without_mixin + rack_test_session = Rack::Test::Session.new(app) + adapter = Webrat::RackSession.new(rack_test_session) + session = Webrat::Session.new(adapter) + + session.visit "/foo" + + assert_equal "spam", session.response_body + assert_equal "spam", rack_test_session.last_response.body + end +end