Skip to content

Commit

Permalink
Test default singleton resource route to ensure it uses GET. This is …
Browse files Browse the repository at this point in the history
…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
geoffgarside authored and NZKoz committed Nov 24, 2008
1 parent 43a06d0 commit b546886
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions actionpack/test/controller/resources_test.rb
Expand Up @@ -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|
Expand Down

0 comments on commit b546886

Please sign in to comment.