aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorGeoff Garside <geoff@geoffgarside.co.uk>2008-11-24 12:23:27 +0000
committerMichael Koziarski <michael@koziarski.com>2008-11-24 19:19:56 +0100
commit61becfe2b99f1d026c300fbe16ac853b2147b3cf (patch)
treebbd551f11e9cbb598a2a699e591bf0ab4b279ef9 /actionpack/test
parenteac16d0ee1f9a46e686503196e3920e2113ccc0a (diff)
downloadrails-61becfe2b99f1d026c300fbe16ac853b2147b3cf.tar.gz
rails-61becfe2b99f1d026c300fbe16ac853b2147b3cf.tar.bz2
rails-61becfe2b99f1d026c300fbe16ac853b2147b3cf.zip
Test default singleton resource route to ensure it uses GET. This is important if using map.root :resource instead of map.root :resources for some reason.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/resources_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb
index 541e8270c9..79b28c0773 100644
--- a/actionpack/test/controller/resources_test.rb
+++ b/actionpack/test/controller/resources_test.rb
@@ -997,6 +997,16 @@ class ResourcesTest < ActionController::TestCase
end
end
+ def test_default_singleton_restful_route_uses_get
+ with_routing do |set|
+ set.draw do |map|
+ map.resource :product
+ end
+
+ assert_equal :get, set.named_routes.routes[:product].conditions[:method]
+ end
+ end
+
protected
def with_restful_routing(*args)
with_routing do |set|