aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorthedarkone <thedarkone2@gmail.com>2011-07-28 20:00:48 +0200
committerXavier Noria <fxn@hashref.com>2011-08-13 16:22:23 -0700
commit37b30d4b4eb983579f083627b3faa065be527a61 (patch)
treecd4cc2d6b194647ec177299f261956f49042018a /actionpack/test
parentc4cf9073a15c7185ee7da345c41e341009a7a690 (diff)
downloadrails-37b30d4b4eb983579f083627b3faa065be527a61.tar.gz
rails-37b30d4b4eb983579f083627b3faa065be527a61.tar.bz2
rails-37b30d4b4eb983579f083627b3faa065be527a61.zip
There is no need to be destructive with the passed-in options.
This fixes a bug that is caused by Resource/SingletonResource mangling resource options when using inline "multi"-resource declarations.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/resources_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb
index 6ea492cf8b..3b1b5fc3ec 100644
--- a/actionpack/test/controller/resources_test.rb
+++ b/actionpack/test/controller/resources_test.rb
@@ -91,6 +91,15 @@ class ResourcesTest < ActionController::TestCase
end
end
+ def test_multiple_resources_with_options
+ expected_options = {:controller => 'threads', :action => 'index'}
+
+ with_restful_routing :messages, :comments, expected_options.slice(:controller) do
+ assert_recognizes(expected_options, :path => 'comments')
+ assert_recognizes(expected_options, :path => 'messages')
+ end
+ end
+
def test_with_custom_conditions
with_restful_routing :messages, :conditions => { :subdomain => 'app' } do
assert @routes.recognize_path("/messages", :method => :get, :subdomain => 'app')