-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
How to set default environment var for RSpec? #2315
Comments
If you want to override RAILS_ENV for a specific test, or for all tests, you can simply do |
@samphippen Thank you ! |
This does not work with Rails 5.1.4 and rspec 3.7. It gladly ignores your ENV setting in the spec helper and will seemingly happily destroy your development database every time, leaving you feeling betrayed and disappointed. Some developers have been known to seek therapy. |
@wedgemartin if you'd like to report a problem, please open an issue in the rspec-rails repo, provide code that is not working how you expect, how you expect it to work, and what it is doing instead. |
Have you try:
|
@shiralwz Thanks it works for me |
Adding this at the top of my rails_helper (above
works |
What happend & What I want
I dont't wanna prefix a
RAILS_ENV=development
every single time## What I have tried ### I tried put `ENV["RAILS_ENV"] ||= 'development'` in top of `spec_helper.rb` but not working
I tried to use dovenv gem but still not working.
what should I do to set default environment to `development`?
Thanks 💃
😄
Thanks for your time~
RSpec is awesome!
The text was updated successfully, but these errors were encountered: