From 4e9fbeb8516581ddaf7a196f8dc0b710cbbce8aa Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 15 Feb 2013 08:28:34 +0000 Subject: Possibility to define the default enable trackers when creating a project (#13175). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11394 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/test_helper.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/test_helper.rb') diff --git a/test/test_helper.rb b/test/test_helper.rb index 410fe1f8a..368a4d41b 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -87,7 +87,15 @@ class ActiveSupport::TestCase end def with_settings(options, &block) - saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].is_a?(Symbol) ? Setting[k] : Setting[k].dup; h} + saved_settings = options.keys.inject({}) do |h, k| + h[k] = case Setting[k] + when Symbol, false, true, nil + Setting[k] + else + Setting[k].dup + end + h + end options.each {|k, v| Setting[k] = v} yield ensure -- cgit v1.2.3