aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionview/test/activerecord/polymorphic_routes_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/actionview/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb
index 76899c7aff..a42888d873 100644
--- a/actionview/test/activerecord/polymorphic_routes_test.rb
+++ b/actionview/test/activerecord/polymorphic_routes_test.rb
@@ -81,7 +81,10 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_string
with_test_routes do
+ # FIXME: why are these different? Symbol case passes through to
+ # `polymorphic_url`, but the String case doesn't.
assert_equal "http://example.com/projects", polymorphic_url("projects")
+ assert_equal "projects", url_for("projects")
end
end
@@ -91,6 +94,19 @@ class PolymorphicRoutesTest < ActionController::TestCase
end
end
+ def test_symbol
+ with_test_routes do
+ assert_equal "http://example.com/projects", polymorphic_url(:projects)
+ assert_equal "http://example.com/projects", url_for(:projects)
+ end
+ end
+
+ def test_symbol_with_options
+ with_test_routes do
+ assert_equal "http://example.com/projects?id=10", polymorphic_url(:projects, :id => 10)
+ end
+ end
+
def test_passing_routes_proxy
with_namespaced_routes(:blog) do
proxy = ActionDispatch::Routing::RoutesProxy.new(_routes, self)