Permalink
Browse files

Fix generic url rewriter in integration tests

  • Loading branch information...
1 parent 24ac3a8 commit 088ce2904d63d15979de561b913e3e88e656f3fa @josh josh committed Sep 25, 2009
@@ -295,7 +295,7 @@ def generic_url_rewriter
"SERVER_PORT" => https? ? "443" : "80",
"HTTPS" => https? ? "on" : "off"
}
- UrlRewriter.new(ActionDispatch::Request.new(env), {})
+ ActionController::UrlRewriter.new(ActionDispatch::Request.new(env), {})
end
end
@@ -1,4 +1,5 @@
require 'abstract_unit'
+require 'controller/fake_controllers'
require 'action_controller/vendor/html-scanner'
class SessionTest < Test::Unit::TestCase
@@ -363,6 +364,10 @@ def test_head
end
end
+ def test_generate_url_with_controller
+ assert_equal 'http://www.example.com/foo', url_for(:controller => "foo")
+ end
+
private
def with_test_route_set
with_routing do |set|
@@ -406,4 +411,8 @@ def test_failed_get
assert_response :not_found
assert_equal '', response.body
end
+
+ def test_generate_url_without_controller
+ assert_equal 'http://www.example.com/foo', url_for(:controller => "foo")
+ end
end

0 comments on commit 088ce29

Please sign in to comment.