mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
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:
committed by
Michael Koziarski
parent
eac16d0ee1
commit
61becfe2b9
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user