Skip to content
This repository
Browse code

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...
commit b546886138258e8b91265455548f07d3303040de 1 parent 43a06d0
Geoff Garside authored November 24, 2008 NZKoz committed November 24, 2008
10  actionpack/test/controller/resources_test.rb
@@ -997,6 +997,16 @@ def test_nested_resource_ignores_except_option
997 997
     end
998 998
   end
999 999
 
  1000
+  def test_default_singleton_restful_route_uses_get
  1001
+    with_routing do |set|
  1002
+      set.draw do |map|
  1003
+        map.resource :product
  1004
+      end
  1005
+
  1006
+      assert_equal :get, set.named_routes.routes[:product].conditions[:method]
  1007
+    end
  1008
+  end
  1009
+
1000 1010
   protected
1001 1011
     def with_restful_routing(*args)
1002 1012
       with_routing do |set|

0 notes on commit b546886

Please sign in to comment.
Something went wrong with that request. Please try again.