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>
This commit is contained in:
Geoff Garside
2008-11-24 12:23:27 +00:00
committed by Michael Koziarski
parent eac16d0ee1
commit 61becfe2b9

View File

@@ -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|