1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

add more tests around the polymorphic url api

This commit is contained in:
Aaron Patterson 2014-05-08 10:33:57 -07:00
parent 6ffce1791a
commit de6cda5e5f

View file

@ -183,6 +183,12 @@ class PolymorphicRoutesTest < ActionController::TestCase
end
end
def test_with_class_list_of_one
with_test_routes do
assert_url "http://example.com/projects", [@project.class]
end
end
def test_with_new_record
with_test_routes do
assert_url "http://example.com/projects", @project
@ -389,6 +395,12 @@ class PolymorphicRoutesTest < ActionController::TestCase
end
end
def test_with_array_containing_single_string_name
with_test_routes do
assert_url "http://example.com/projects", ["projects"]
end
end
def test_with_array_containing_symbols
with_test_routes do
assert_url "http://example.com/series/new", [:new, :series]