-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
4.0.0beta4 reports RSpec::Core::ExampleGroup::WrongScopeError Exception: default_url_options
is not available on an example group
#2276
Comments
Can you please provide a minimized version of the spec file to reproduce this? |
Can you provide the spec that triggers this? Don't mind if you scrub the names etc, just looking for the RSpec structure. A stacktrace would be equally helpful, |
I also ran into this when upgrading from 4.0.0.beta3 to 4.0.0.beta4. I've opened #2277 which includes a minimised version of the problematic example group from my application as a regression test. |
The PR from @eugeneius pointed me towards the problem. My spec was this:
This gave the error on the Change the outer The full rspec output is below.
|
For specs residing in So there are two problems with this code:
Do you think this is something that |
Thats not a problem, magic spec directories can be turned off. |
Agree. Another option to resolve the issue is to override
|
I'd just turn them off, it'll get removed at some point. |
I'm in two minds about the nested feature situation, its a bit weird, but it is just an alias for describe. |
|
Yes thats by design, my point is theres no reason why you can't group a couple of features into one file, it just wasn't intended to be used like that |
@eugeneius points out that if the outer example group has Wondering if the issue is reproducible if |
Thanks all!
El lun., 10 de feb. de 2020 a la(s) 17:30, Jon Rowe (
notifications@github.com) escribió:
… Closed #2276 <#2276> via #2277
<#2277>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2276?email_source=notifications&email_token=ACL5SUYKKD332ZGLXR4PEITRCGFL3A5CNFSM4KSAXZTKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOWQ4YYCA#event-3023670280>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACL5SU23LJZCCNPUNZWN2ETRCGFL3ANCNFSM4KSAXZTA>
.
|
What Ruby, Rails and RSpec versions are you using?
Ruby version: 2.6.4
Rails version: 6.0.2.1
RSpec version: 4.0.0.beta4
Observed behaviour
rspec-rails is unable to set
default_url_options[:host]
to::RSpec::Rails::FeatureExampleGroup::DEFAULT_HOST
asdefault_url_options
is not defined.Here's the output from byebug inserted just before the exception is raised:
Expected behaviour
default_url_options[:host]
is set correctly.This error does not happen on 4.0.0beta3
Can you provide an example app?
Not right now, sorry.
The text was updated successfully, but these errors were encountered: