diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-12-02 11:13:28 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-12-02 11:13:28 +0000 |
commit | 12d1372ae54b0bfeeef6ce868a7ad153b391706c (patch) | |
tree | 196239c815f5c9e518b59bdd91c58651adaf0e14 /test/unit/project_test.rb | |
parent | 3c423df203476429a3875f18d307992c3f9693bc (diff) | |
download | redmine-12d1372ae54b0bfeeef6ce868a7ad153b391706c.tar.gz redmine-12d1372ae54b0bfeeef6ce868a7ad153b391706c.zip |
Let admin users unarchive subprojects of archived projects (#29993).
git-svn-id: http://svn.redmine.org/redmine/trunk@17681 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r-- | test/unit/project_test.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index d86c30d13..ccbb92225 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -192,18 +192,23 @@ class ProjectTest < ActiveSupport::TestCase def test_unarchive user = @ecookbook.members.first.user @ecookbook.archive - # A subproject of an archived project can not be unarchived - assert !@ecookbook_sub1.unarchive # Unarchive project assert @ecookbook.unarchive - @ecookbook.reload assert @ecookbook.active? assert !@ecookbook.archived? assert user.projects.include?(@ecookbook) - # Subproject can now be unarchived + end + + def test_unarchive_child_project_should_unarchive_ancestors + @ecookbook.archive @ecookbook_sub1.reload - assert @ecookbook_sub1.unarchive + assert_equal Project::STATUS_ARCHIVED, @ecookbook_sub1.status + + @ecookbook_sub1.unarchive + assert_equal Project::STATUS_ACTIVE, @ecookbook_sub1.status + @ecookbook.reload + assert_equal Project::STATUS_ACTIVE, @ecookbook.status end def test_unarchive_a_child_of_a_closed_project_should_set_status_to_closed |