Skip to content

Commit af86444

Browse files
committed
apparently passing a string to polymorphic_url is something we support
o_O
1 parent 57e5098 commit af86444

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

actionview/test/activerecord/polymorphic_routes_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ def assert_url(url, args)
7979
assert_equal url, url_for(args)
8080
end
8181

82+
def test_string
83+
with_test_routes do
84+
assert_equal "http://example.com/projects", polymorphic_url("projects")
85+
end
86+
end
87+
88+
def test_string_with_options
89+
with_test_routes do
90+
assert_equal "http://example.com/projects?id=10", polymorphic_url("projects", :id => 10)
91+
end
92+
end
93+
8294
def test_passing_routes_proxy
8395
with_namespaced_routes(:blog) do
8496
proxy = ActionDispatch::Routing::RoutesProxy.new(_routes, self)

0 commit comments

Comments
 (0)