Permalink
Browse files

apparently passing a string to polymorphic_url is something we support

o_O
  • Loading branch information...
tenderlove committed May 7, 2014
1 parent 57e5098 commit af864447f182e20bebebdb151201343e7d6c4904
Showing with 12 additions and 0 deletions.
  1. +12 −0 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

This comment has been minimized.

Show comment
Hide comment
@aquajach

aquajach May 7, 2014

Contributor

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

Contributor

aquajach commented on af86444 May 7, 2014

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

Please sign in to comment.