-
-
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
6.0.0 Release Loads .rspec Configuration #2623
Comments
This is most probably caused by this change. We need to load I'd suggest wrapping all the |
Ah, that'd do it. Any reason that check couldn't be something added to the rails_helper that's generated on the install? |
The primary reason is that some projects include parts that are testable without loading up the whole Rails env, and they don't need Our RSpec Core's There are also some scenarios when specs are called initially in the |
We could add a note about it to the generated |
What Ruby, Rails and RSpec versions are you using?
Ruby version: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
Rails version: 7.0.4
RSpec 3.11
Observed behaviour
For release 5.1.2 we could configure rspec-rails to use rails_helper.rb in the .rspec config file (instead of adding require
rails_helper
in each individual spec).With release 6.0.0 we appear to now load the
.rspec
config file when we use the Rails generator for creating a model. This then loadsrails_helper.rb
which throws a pending migration error since the generated model's migration has not yet run.For example:
Expected behaviour
We should do one of the following:
rails_helper
in the.rspec
configuration is deprecated moving forwardCan you provide an example app?
https://github.com/gordysc/rspec-generator-issue
The text was updated successfully, but these errors were encountered: