aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-03-17 23:45:42 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-03-17 23:45:42 +0000
commitdb083299465bdb89297e180e9635d4ea102c8e19 (patch)
tree01d3ac3b40f66d90fb8d9ff0ef03cff8e6056362 /actionpack/test
parent3c0fd445c0a36c36cbd8c4259a28a978a8e8eb83 (diff)
downloadrails-db083299465bdb89297e180e9635d4ea102c8e19.tar.gz
rails-db083299465bdb89297e180e9635d4ea102c8e19.tar.bz2
rails-db083299465bdb89297e180e9635d4ea102c8e19.zip
Fixed that polymorphic routes would modify the input array (closes #11363) [thomas.lee]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9053 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/polymorphic_routes_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/polymorphic_routes_test.rb b/actionpack/test/controller/polymorphic_routes_test.rb
index 90c149a830..0d349a360c 100644
--- a/actionpack/test/controller/polymorphic_routes_test.rb
+++ b/actionpack/test/controller/polymorphic_routes_test.rb
@@ -125,5 +125,12 @@ uses_mocha 'polymorphic URL helpers' do
polymorphic_path(@article, :action => :new)
end
+ def test_polymorphic_path_does_not_modify_arguments
+ expects(:admin_article_responses_url).with(@article)
+ path = [:admin, @article, @response]
+ assert_no_difference 'path.size' do
+ polymorphic_url(path)
+ end
+ end
end
end