Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

2 participants

@dosire

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.

@dosire

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

@rafaelfranca

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

@dosire

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

@rafaelfranca

@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
View
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 'http://api.example.com/', :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.