diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-01 06:56:53 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-01 12:53:53 -0300 |
commit | 3b5bc8d71ba97ddc254ab3dc81893c82e81a783b (patch) | |
tree | e8795edca810d6413fbe808619912e018baf08ba /actionpack/test/dispatch/routing_test.rb | |
parent | a02f67b39b0ca02a8dd871b75c9f2a9db3a40c7b (diff) | |
download | rails-3b5bc8d71ba97ddc254ab3dc81893c82e81a783b.tar.gz rails-3b5bc8d71ba97ddc254ab3dc81893c82e81a783b.tar.bz2 rails-3b5bc8d71ba97ddc254ab3dc81893c82e81a783b.zip |
Merge pull request #7789 from senny/7777_resource_functions_modify_options
resource and resources do no longer modify passed options
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index dc1f524d3b..f32b1b9c71 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -1186,6 +1186,26 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_resource_does_not_modify_passed_options + options = {:id => /.+?/, :format => /json|xml/} + self.class.stub_controllers do |routes| + routes.draw do + resource :user, options + end + end + assert_equal({:id => /.+?/, :format => /json|xml/}, options) + end + + def test_resources_does_not_modify_passed_options + options = {:id => /.+?/, :format => /json|xml/} + self.class.stub_controllers do |routes| + routes.draw do + resources :users, options + end + end + assert_equal({:id => /.+?/, :format => /json|xml/}, options) + end + def test_path_names with_test_routes do get '/pt/projetos' |