Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Documentation fix: Note that you can also pass a full url to assert_recognizes and assert_generates #7114

wants to merge 1 commit into from

2 participants


Right now the documentation doesn't mention that the path argument for assert_recognizes and assert_generates can be a full url. This has been possible since this pull request was accepted two years ago: 7c9bf45

Let me know if I can improve anything in this PR.


I just found out about docrails, please let me know if I should submit there instead of here.


Yes, please commit directly there because there are people that review the commits.


Thank you for the feedback Rafael. I committed it to docrails rails/docrails@5a6f30f


@dosire thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  actionpack/lib/action_dispatch/testing/assertions/routing.rb
3  actionpack/lib/action_dispatch/testing/assertions/routing.rb
@@ -110,6 +110,9 @@ def assert_generates(expected_path, options, defaults={}, extras = {}, message=n
# # Tests a route with a HTTP method
# assert_routing({ :method => 'put', :path => '/product/321' }, { :controller => "product", :action => "update", :id => "321" })
+ #
+ # # Path can be a full url (with ://) to test routing based on constrains such as subdomain or host
+ # assert_routing '', :controller => 'api', :action => 'index'
def assert_routing(path, options, defaults={}, extras={}, message=nil)
assert_recognizes(options, path, extras, message)
Something went wrong with that request. Please try again.