From fb4e4e0eff91240e27737b6f37c7aecf0073224a Mon Sep 17 00:00:00 2001 From: "Mark D. Blackwell" Date: Tue, 26 Mar 2013 21:05:11 -0400 Subject: [PATCH] Prevent wrong database loss during testing --- spec/spec_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 280231a..bf35252 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,7 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' -ENV["RAILS_ENV"] ||= 'test' +# It's dangerous to use `||=' when setting ENV['RAILS_ENV'] here; see +# https://github.com/rails/rails/issues/7175 +ENV["RAILS_ENV"] = 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'email_spec'