From af864447f182e20bebebdb151201343e7d6c4904 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 6 May 2014 18:10:44 -0700 Subject: apparently passing a string to polymorphic_url is something we support o_O --- actionview/test/activerecord/polymorphic_routes_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionview') diff --git a/actionview/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb index eee4d7accc..76899c7aff 100644 --- a/actionview/test/activerecord/polymorphic_routes_test.rb +++ b/actionview/test/activerecord/polymorphic_routes_test.rb @@ -79,6 +79,18 @@ class PolymorphicRoutesTest < ActionController::TestCase 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) -- cgit v1.2.3