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:
parent
6ffce1791a
commit
de6cda5e5f
1 changed files with 12 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue