aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/polymorphic_routes_test.rb
diff options
context:
space:
mode:
authorhiroshi <hiroshi3110@gmail.com>2008-11-03 14:09:07 +0900
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-11-14 12:07:52 +0100
commit94d6716324126028b89dde886f160474049b1b0c (patch)
treec40c86bb253900d68717684d0fbae89bc1936406 /actionpack/test/controller/polymorphic_routes_test.rb
parentff4ccb8334e4f5b5bdccbd5dc6876b4e43d9565e (diff)
downloadrails-94d6716324126028b89dde886f160474049b1b0c.tar.gz
rails-94d6716324126028b89dde886f160474049b1b0c.tar.bz2
rails-94d6716324126028b89dde886f160474049b1b0c.zip
Make polymorphic_url compact given array [#1317 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
Diffstat (limited to 'actionpack/test/controller/polymorphic_routes_test.rb')
-rw-r--r--actionpack/test/controller/polymorphic_routes_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/polymorphic_routes_test.rb b/actionpack/test/controller/polymorphic_routes_test.rb
index 6ddf2826cd..620f2b3ab5 100644
--- a/actionpack/test/controller/polymorphic_routes_test.rb
+++ b/actionpack/test/controller/polymorphic_routes_test.rb
@@ -169,6 +169,17 @@ uses_mocha 'polymorphic URL helpers' do
polymorphic_url([@article, :response, @tag], :format => :pdf)
end
+ def test_nesting_with_array_containing_nil
+ expects(:article_response_url).with(@article)
+ polymorphic_url([@article, nil, :response])
+ end
+
+ def test_with_array_containing_single_object
+ @article.save
+ expects(:article_url).with(@article)
+ polymorphic_url([nil, @article])
+ end
+
# TODO: Needs to be updated to correctly know about whether the object is in a hash or not
def xtest_with_hash
expects(:article_url).with(@article)