From e89093aeb4b1f544cb54caf54a0374075250cc59 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 11 Apr 2008 12:34:44 -0500 Subject: Fixed that formatted_polymorphic_route should be able to take the :format as part of a single hash or as the option hash (references #8741) --- actionpack/test/controller/polymorphic_routes_test.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/polymorphic_routes_test.rb b/actionpack/test/controller/polymorphic_routes_test.rb index 0d349a360c..4ec0d3cd4e 100644 --- a/actionpack/test/controller/polymorphic_routes_test.rb +++ b/actionpack/test/controller/polymorphic_routes_test.rb @@ -65,13 +65,18 @@ uses_mocha 'polymorphic URL helpers' do formatted_polymorphic_url([@article, :pdf]) end - # TODO: should this work? - def xtest_format_option + def test_format_option @article.save - expects(:article_url).with(@article, :format => :pdf) + expects(:article_url).with(@article, :pdf) polymorphic_url(@article, :format => :pdf) end + def test_id_and_format_option + @article.save + expects(:article_url).with(:id => @article, :format => :pdf) + polymorphic_url(:id => @article, :format => :pdf) + end + def test_with_nested @response.save expects(:article_response_url).with(@article, @response) -- cgit v1.2.3