Permalink
Browse files

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>
  • Loading branch information...
1 parent 43a06d0 commit b546886138258e8b91265455548f07d3303040de @geoffgarside geoffgarside committed with NZKoz Nov 24, 2008
Showing with 10 additions and 0 deletions.
  1. +10 −0 actionpack/test/controller/resources_test.rb
@@ -997,6 +997,16 @@ def test_nested_resource_ignores_except_option
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|

0 comments on commit b546886

Please sign in to comment.