Let admin users unarchive subprojects of archived projects (#29993).

git-svn-id: http://svn.redmine.org/redmine/trunk@17681 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2018-12-02 11:13:28 +00:00
parent 3c423df203
commit 12d1372ae5
3 changed files with 15 additions and 14 deletions

View File

@@ -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