diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/dispatcher_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/polymorphic_routes_test.rb | 11 | ||||
-rw-r--r-- | actionpack/test/controller/resources_test.rb | 6 |
3 files changed, 15 insertions, 4 deletions
diff --git a/actionpack/test/controller/dispatcher_test.rb b/actionpack/test/controller/dispatcher_test.rb index 84a1c9aab9..9f90872734 100644 --- a/actionpack/test/controller/dispatcher_test.rb +++ b/actionpack/test/controller/dispatcher_test.rb @@ -41,7 +41,7 @@ class DispatcherTest < Test::Unit::TestCase CGI.expects(:new).raises('some multipart parsing failure') ActionController::Routing::Routes.stubs(:reload) - Dispatcher.stubs(:log_failsafe_exception) + Dispatcher.any_instance.stubs(:log_failsafe_exception) assert_nothing_raised { dispatch } 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) diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index c62a2043d9..0f1ac30f04 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -76,6 +76,12 @@ class ResourcesTest < Test::Unit::TestCase end end + def test_override_paths_for_default_restful_actions + resource = ActionController::Resources::Resource.new(:messages, + :path_names => {:new => 'nuevo', :edit => 'editar'}) + assert_equal resource.new_path, "#{resource.path}/nuevo" + end + def test_multiple_default_restful_routes with_restful_routing :messages, :comments do assert_simply_restful_for :messages |