Skip to content
Browse files

apparently passing a string to polymorphic_url is something we support

o_O
  • Loading branch information...
1 parent 57e5098 commit af864447f182e20bebebdb151201343e7d6c4904 @tenderlove tenderlove committed May 6, 2014
Showing with 12 additions and 0 deletions.
  1. +12 −0 actionview/test/activerecord/polymorphic_routes_test.rb
View
12 actionview/test/activerecord/polymorphic_routes_test.rb
@@ -79,6 +79,18 @@ def assert_url(url, args)
assert_equal url, url_for(args)
end
+ def test_string
+ with_test_routes do
+ assert_equal "http://example.com/projects", polymorphic_url("projects")
+ end
+ end
+
+ def test_string_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)

1 comment on commit af86444

@aquajach

Not like ruby 1.9 hash syntax (e.g. id: 10) by far?

Please sign in to comment.
Something went wrong with that request. Please try again.