Commit 5760c6d0f22e80b03a7bd5ed3ec01fd117b19c7b
1 parent
4d1ac1fe
Exists in
master
and in
29 other branches
ActionItem237: do not load local configuration when running tests
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1635 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
6 additions
and
5 deletions
Show diff stats
config/environment.rb
... | ... | @@ -98,9 +98,10 @@ require 'acts_as_having_boxes' |
98 | 98 | require 'acts_as_having_settings' |
99 | 99 | require 'hacked_after_create' |
100 | 100 | |
101 | -# load a local configuration if present | |
102 | -lambda do |localconfig| | |
103 | - if File.exists?(localconfig) | |
104 | - require localconfig | |
101 | +# load a local configuration if present, but not under test environment. | |
102 | +if ENV['RAILS_ENV'] != 'test' | |
103 | + localconfigfile = File.join(RAILS_ROOT, 'config', 'local.rb') | |
104 | + if File.exists?(localconfigfile) | |
105 | + require localconfigfile | |
105 | 106 | end |
106 | -end.call(File.join(RAILS_ROOT, 'config', 'local.rb')) | |
107 | +end | ... | ... |