Version sharing (#465) + optional inclusion of subprojects in the roadmap view (#2666).

Each version of a project can be shared with:
* subprojects
* projects in the project hierarchy: ancestors + descendants (needs versions management permission on the root project)
* projects in the project tree: root project + all its descendants (same as above)
* all projects (can be set by admin users only)

Notes:
* when sharing a version of a private project with others projects, its name will be visible within the other projects
* a project with versions used by non descendant projects can not be archived

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3123 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-12-06 10:28:20 +00:00
parent e178123569
commit 5f8e9d7118
40 changed files with 659 additions and 75 deletions
+40
View File
@@ -329,6 +329,46 @@ class IssueTest < ActiveSupport::TestCase
assert_nil issue.category_id
end
def test_move_to_another_project_should_clear_fixed_version_when_not_shared
issue = Issue.find(1)
issue.update_attribute(:fixed_version_id, 1)
assert issue.move_to(Project.find(2))
issue.reload
assert_equal 2, issue.project_id
# Cleared fixed_version
assert_equal nil, issue.fixed_version
end
def test_move_to_another_project_should_keep_fixed_version_when_shared_with_the_target_project
issue = Issue.find(1)
issue.update_attribute(:fixed_version_id, 4)
assert issue.move_to(Project.find(5))
issue.reload
assert_equal 5, issue.project_id
# Keep fixed_version
assert_equal 4, issue.fixed_version_id
end
def test_move_to_another_project_should_clear_fixed_version_when_not_shared_with_the_target_project
issue = Issue.find(1)
issue.update_attribute(:fixed_version_id, 1)
assert issue.move_to(Project.find(5))
issue.reload
assert_equal 5, issue.project_id
# Cleared fixed_version
assert_equal nil, issue.fixed_version
end
def test_move_to_another_project_should_keep_fixed_version_when_shared_systemwide
issue = Issue.find(1)
issue.update_attribute(:fixed_version_id, 7)
assert issue.move_to(Project.find(2))
issue.reload
assert_equal 2, issue.project_id
# Keep fixed_version
assert_equal 7, issue.fixed_version_id
end
def test_copy_to_the_same_project
issue = Issue.find(1)
copy = nil