aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-06 15:59:28 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-06 15:59:58 -0700
commite60c55d846dc1a9956c585b0b493d92c9aa46e6b (patch)
treeaff3f8c6d8bec63a2491793cdfc1524a41468993 /actionview/test
parent5fb2e9211c403f8b7be1ac015ef61c16790c8e66 (diff)
downloadrails-e60c55d846dc1a9956c585b0b493d92c9aa46e6b.tar.gz
rails-e60c55d846dc1a9956c585b0b493d92c9aa46e6b.tar.bz2
rails-e60c55d846dc1a9956c585b0b493d92c9aa46e6b.zip
add a test for the parameters sent to the url helper for new records
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/activerecord/polymorphic_routes_test.rb15
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 1ead18518a..0c3d563155 100644
--- a/actionview/test/activerecord/polymorphic_routes_test.rb
+++ b/actionview/test/activerecord/polymorphic_routes_test.rb
@@ -156,6 +156,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