Permalink
Browse files

Fixed force of default settings in test environment

  • Loading branch information...
1 parent e7f35b7 commit eabf566ee439598e443aedc8198811bf232fe069 @ndbroadbent ndbroadbent committed May 10, 2012
Showing with 4 additions and 9 deletions.
  1. +4 −5 app/models/setting.rb
  2. +0 −4 spec/spec_helper.rb
View
@@ -126,11 +126,10 @@ def load_settings_from_yaml(file)
end
-# Preload YAML settings.
# Load default settings, then override with custom settings, if present.
-[
- FatFreeCRM.root.join("config", "settings.default.yml"),
- Rails.root.join("config", "settings.yml")
-].each do |settings_file|
+setting_files = [FatFreeCRM.root.join("config", "settings.default.yml")]
+# Don't override default settings in test environment
+setting_files << Rails.root.join("config", "settings.yml") unless Rails.env == 'test'
+setting_files.each do |settings_file|
Setting.load_settings_from_yaml(settings_file) if File.exist?(settings_file)
end
View
@@ -33,10 +33,6 @@
I18n.locale = 'en-US'
- # Force default settings
- Setting.yaml_settings = {}.with_indifferent_access
- Setting.load_settings_from_yaml(FatFreeCRM.root.join("config", "settings.default.yml"))
-
Paperclip.options[:log] = false
RSpec.configure do |config|

0 comments on commit eabf566

Please sign in to comment.