-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Prevent running in production mode by default. #1383
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
Conversation
Many setups start tests by truncating the database tables. Running the specs in production would, horribly, would delete all of the data. This checks to make sure Rails is not in production before loading rspec-rails and the configuration. If production mode is detected the run will abort immediately. Resolve #1382
LGTM |
6e7c8d4
to
5d27de7
Compare
Prevent running in production mode by default.
thanks, running this on production made me loose my job. |
😢 Sorry to hear that! Wish we had thought to put this in place sooner. Good luck with the job search! Frankly, an employer that fires employees over mistakes is not fostering the kind of environment I'd want to work in. I hope you find a better place to work! |
😭 I'm sorry. I hope this turns out to be a good thing in disguise for you. 💙 |
It's worth noting that the default environment is actually development, you'd have to have the environment variable set elsewhere to get into production mode, and have production credentials on your development machine (or worse be developing on a production machine) but this is still a sensible precaution. Hope you find a new job soon! |
Suspenders was checking for the presence of `DATABASE_URL` to see if it was running in production. This isn't so reliable in practice as `DATABASE_URL` can be used in other environments. The spirit of this was originally to stop you truncating a production database, which checking for the Rails environment acheives. #872 rspec/rspec-rails#1383
Suspenders was checking for the presence of `DATABASE_URL` to see if it was running in production. This isn't so reliable in practice as `DATABASE_URL` can be used in other environments. The spirit of this was originally to stop you truncating a production database, which checking for the Rails environment acheives. #872 rspec/rspec-rails#1383
Suspenders was checking for the presence of `DATABASE_URL` to see if it was running in production. This isn't so reliable in practice as `DATABASE_URL` can be used in other environments. The spirit of this was originally to stop you truncating a production database, which checking for the Rails environment acheives. thoughtbot/suspenders#872 rspec/rspec-rails#1383
Many setups start tests by truncating the database tables. Running the
specs in production would, horribly, would delete all of the data. This
checks to make sure Rails is not in production before loading
rspec-rails and the configuration. If production mode is detected the
run will abort immediately.
Resolve #1382