Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore respond_to? check for default_url_options #2277

Merged
merged 1 commit into from Feb 10, 2020

Conversation

eugeneius
Copy link
Contributor

Fixes #2276.
Reverts part of #2226.

Feature example groups usually have a default_url_options class attribute, but it's not added if the method is already defined:

https://github.com/rails/rails/blob/v6.0.2.1/actionpack/lib/action_dispatch/routing/url_for.rb#L92

Request example groups have a default_url_options instance method:

https://github.com/rails/rails/blob/v6.0.2.1/actionpack/lib/action_dispatch/testing/integration.rb#L388

This means that when a feature example group is defined inside a request example group, it will only have the instance method, and trying to call default_url_options on the example group will fail.

Reverts part of d52a135.

Feature example groups usually have a `default_url_options` class
attribute, but it's not added if the method is already defined:

https://github.com/rails/rails/blob/v6.0.2.1/actionpack/lib/action_dispatch/routing/url_for.rb#L92

Request example groups have a `default_url_options` instance method:

https://github.com/rails/rails/blob/v6.0.2.1/actionpack/lib/action_dispatch/testing/integration.rb#L388

This means that when a feature example group is defined inside a request
example group, it will only have the instance method, and trying to call
`default_url_options` on the example group will fail.
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.

LGTM. Thanks

@JonRowe JonRowe merged commit eb67808 into rspec:master Feb 10, 2020
@JonRowe
Copy link
Member

JonRowe commented Feb 10, 2020

I've merged this because I think its the easiest solution, we could probably find a better way of setting his, I ruled out app directly as I think it will leak but for now we'll get this into the next beta.

JonRowe added a commit that referenced this pull request Feb 10, 2020
@nbulaj
Copy link

nbulaj commented Mar 11, 2020

@eugeneius thanks for the fix, I hope it's also would be in 4.0 release because beta4 breaks CI pipeline for me

JonRowe added a commit that referenced this pull request Mar 13, 2020
Restore respond_to? check for default_url_options
JonRowe added a commit that referenced this pull request Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants