summaryrefslogtreecommitdiffstats
path: root/test/unit/project_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-15 08:28:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-15 08:28:34 +0000
commit4e9fbeb8516581ddaf7a196f8dc0b710cbbce8aa (patch)
tree802754f9290459f930f24bd65f20edf2dda331bc /test/unit/project_test.rb
parent348a1d59efe207878384a75116bcc09928427556 (diff)
downloadredmine-4e9fbeb8516581ddaf7a196f8dc0b710cbbce8aa.tar.gz
redmine-4e9fbeb8516581ddaf7a196f8dc0b710cbbce8aa.zip
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
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r--test/unit/project_test.rb25
1 files changed, 23 insertions, 2 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index b9aabebed..c6ba4cd72 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -74,9 +74,30 @@ class ProjectTest < ActiveSupport::TestCase
with_settings :default_projects_modules => ['issue_tracking', 'repository'] do
assert_equal ['issue_tracking', 'repository'], Project.new.enabled_module_names
end
+ end
+
+ def test_default_trackers_should_match_default_tracker_ids_setting
+ with_settings :default_projects_tracker_ids => ['1', '3'] do
+ assert_equal Tracker.find(1, 3).sort, Project.new.trackers.sort
+ end
+ end
- assert_equal Tracker.all.sort, Project.new.trackers.sort
- assert_equal Tracker.find(1, 3).sort, Project.new(:tracker_ids => [1, 3]).trackers.sort
+ def test_default_trackers_should_be_all_trackers_with_blank_setting
+ with_settings :default_projects_tracker_ids => nil do
+ assert_equal Tracker.all.sort, Project.new.trackers.sort
+ end
+ end
+
+ def test_default_trackers_should_be_empty_with_empty_setting
+ with_settings :default_projects_tracker_ids => [] do
+ assert_equal [], Project.new.trackers
+ end
+ end
+
+ def test_default_trackers_should_not_replace_initialized_trackers
+ with_settings :default_projects_tracker_ids => ['1', '3'] do
+ assert_equal Tracker.find(1, 2).sort, Project.new(:tracker_ids => [1, 2]).trackers.sort
+ end
end
def test_update