diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-06 15:59:28 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-12 15:54:44 -0700 |
commit | b451648e1f611f574ed67f80ca4e9cc600488981 (patch) | |
tree | 71cab45fcd076212c0b183b9785b0711bbc0fb63 | |
parent | d94cd869c82bc52388b670553ee08ad34679fc42 (diff) | |
download | rails-b451648e1f611f574ed67f80ca4e9cc600488981.tar.gz rails-b451648e1f611f574ed67f80ca4e9cc600488981.tar.bz2 rails-b451648e1f611f574ed67f80ca4e9cc600488981.zip |
add a test for the parameters sent to the url helper for new records
-rw-r--r-- | actionview/test/activerecord/polymorphic_routes_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionview/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb index fef27ef492..f6ff3069f8 100644 --- a/actionview/test/activerecord/polymorphic_routes_test.rb +++ b/actionview/test/activerecord/polymorphic_routes_test.rb @@ -242,6 +242,21 @@ class PolymorphicRoutesTest < ActionController::TestCase end end + def test_new_record_arguments + params = nil + extend Module.new { + define_method("projects_url") { |*args| + params = args + super(*args) + } + } + + with_test_routes do + assert_equal "http://example.com/projects", polymorphic_url(@project) + assert_equal [], params + end + end + def test_with_destroyed_record with_test_routes do @project.destroy |