aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-01-30 01:25:44 +0000
committerMichael Koziarski <michael@koziarski.com>2008-01-30 01:25:44 +0000
commit900d6d7bd24519cbcab11b18ae42ae843e3b8aa9 (patch)
tree6bddcb98e3558b40e9bffab37ffd04247de302be /actionpack/lib
parent9623264c0946e334c0811f2b585208476d12aa00 (diff)
downloadrails-900d6d7bd24519cbcab11b18ae42ae843e3b8aa9.tar.gz
rails-900d6d7bd24519cbcab11b18ae42ae843e3b8aa9.tar.bz2
rails-900d6d7bd24519cbcab11b18ae42ae843e3b8aa9.zip
Make assert_routing aware of the HTTP method used. Closes #8039 [mpalmer]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8748 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/assertions/routing_assertions.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/assertions/routing_assertions.rb b/actionpack/lib/action_controller/assertions/routing_assertions.rb
index 9bff283245..2acd003243 100644
--- a/actionpack/lib/action_controller/assertions/routing_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/routing_assertions.rb
@@ -114,6 +114,9 @@ module ActionController
#
# # Tests a route, providing a defaults hash
# assert_routing 'controller/action/9', {:id => "9", :item => "square"}, {:controller => "controller", :action => "action"}, {}, {:item => "square"}
+ #
+ # # Tests a route with a HTTP method
+ # assert_routing({ :method => 'put', :path => '/product/321' }, { :controller => "product", :action => "update", :id => "321" })
def assert_routing(path, options, defaults={}, extras={}, message=nil)
assert_recognizes(options, path, extras, message)
@@ -122,7 +125,7 @@ module ActionController
options[:controller] = "/#{controller}"
end
- assert_generates(path, options, defaults, extras, message)
+ assert_generates(path.is_a?(Hash) ? path[:path] : path, options, defaults, extras, message)
end
private
@@ -140,4 +143,4 @@ module ActionController
end
end
end
-end \ No newline at end of file
+end