diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-03 20:21:03 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-03 20:21:03 +0000 |
commit | 5222650d952390d3435848397a46d8aa1dbda09e (patch) | |
tree | 6ef084faa30f3bba0d0d1e361247f86c1f4da21d /test/unit/project_test.rb | |
parent | 1059f9a99ec41a8e320d4d66684e65d183270920 (diff) | |
download | redmine-5222650d952390d3435848397a46d8aa1dbda09e.tar.gz redmine-5222650d952390d3435848397a46d8aa1dbda09e.zip |
Adds a few tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@13695 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r-- | test/unit/project_test.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index 4723b4638..02bcfccbd 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -647,6 +647,12 @@ class ProjectTest < ActiveSupport::TestCase end end + def test_enabled_modules_names_with_nil_should_clear_modules + p = Project.find(1) + p.enabled_module_names = nil + assert_equal [], p.enabled_modules + end + test "enabled_modules should define module by names and preserve ids" do @project = Project.find(1) # Remove one module @@ -947,4 +953,23 @@ class ProjectTest < ActiveSupport::TestCase assert_equal [Role.anonymous], project.override_roles(Role.anonymous) assert_equal [Role.non_member], project.override_roles(Role.non_member) end + + def test_css_classes + p = Project.new + assert_kind_of String, p.css_classes + assert_not_include 'archived', p.css_classes.split + assert_not_include 'closed', p.css_classes.split + end + + def test_css_classes_for_archived_project + p = Project.new + p.status = Project::STATUS_ARCHIVED + assert_include 'archived', p.css_classes.split + end + + def test_css_classes_for_closed_project + p = Project.new + p.status = Project::STATUS_CLOSED + assert_include 'closed', p.css_classes.split + end end |