Skip to content

Conversation

@meshulam
Copy link
Contributor

The route_to matcher delegates to assert_recognizes. This assertion only tests path=>params, not that the provided params also generate the expected path as assert_routing does.

It would be great to have an rspec matcher for the inverse (generate_route perhaps?) but at the very least I figured the readme should be corrected. The full docs on relishapp.com seem to be correct already.

The `route_to` matcher [delegates to assert_recognizes](https://github.com/rspec/rspec-rails/blob/main/lib/rspec/rails/matchers/routing_matchers.rb#L27). This assertion only tests path=>params, not that the provided params also generate the expected path [as `assert_routing` does](https://api.rubyonrails.org/v6.1.0/classes/ActionDispatch/Assertions/RoutingAssertions.html). 

It would be great to have an rspec matcher for the inverse (`generate_route` perhaps?) but at the very least I figured the readme should be corrected. The full docs on relishapp.com seem to be correct already.
Copy link
Member

@benoittgt benoittgt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @meshulam for this change. LGTM

@JonRowe JonRowe merged commit 0088716 into rspec:main Dec 17, 2020
@JonRowe
Copy link
Member

JonRowe commented Dec 17, 2020

Thanks!

JonRowe added a commit that referenced this pull request Dec 26, 2020
Correct route_to documentation in README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants