commit
661fe7ef30
|
@ -323,7 +323,7 @@ After copying and pasting code to do this several times I decided to package it
|
|||
|
||||
DatabaseCleaner comes with safeguards against:
|
||||
|
||||
* Running in production (checking for `ENV`, `RACK_ENV`, and `RAILS_ENV`)
|
||||
* Running in production (checking for `ENV`, `APP_ENV`, `RACK_ENV`, and `RAILS_ENV`)
|
||||
* Running against a remote database (checking for a `DATABASE_URL` that does not include `localhost`, `.local` or `127.0.0.1`)
|
||||
|
||||
Both safeguards can be disabled separately as follows.
|
||||
|
|
|
@ -72,7 +72,7 @@ module DatabaseCleaner
|
|||
end
|
||||
|
||||
class Production
|
||||
KEYS = %w(ENV RACK_ENV RAILS_ENV)
|
||||
KEYS = %w(ENV APP_ENV RACK_ENV RAILS_ENV)
|
||||
|
||||
def run
|
||||
raise Error::ProductionEnv.new(key) if !skip? && given?
|
||||
|
|
|
@ -126,7 +126,7 @@ module DatabaseCleaner
|
|||
end
|
||||
|
||||
describe 'ENV is set to production' do
|
||||
%w(ENV RACK_ENV RAILS_ENV).each do |key|
|
||||
%w(ENV APP_ENV RACK_ENV RAILS_ENV).each do |key|
|
||||
describe "on #{key}" do
|
||||
before { stub_const('ENV', key => "production") }
|
||||
|
||||
|
|
Loading…
Reference in New Issue