summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-27 19:36:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-27 19:36:53 +0000
commit9eb041fbc7999af55c13aa93d2c2df027f8faf73 (patch)
tree4987b0520ed5f5be67bab56fb3f194498d2fbfb3 /test
parented165f671620409c39830a7d8326d37c27ea2fc1 (diff)
downloadredmine-9eb041fbc7999af55c13aa93d2c2df027f8faf73.tar.gz
redmine-9eb041fbc7999af55c13aa93d2c2df027f8faf73.zip
Versions that are not shared should not be assignable when selecting another project (#11506).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10086 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/issue_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index a89b2b315..97d0a4829 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -760,6 +760,26 @@ class IssueTest < ActiveSupport::TestCase
assert issue.save
end
+ def test_should_not_be_able_to_keep_unshared_version_when_changing_project
+ issue = Issue.find(2)
+ assert_equal 2, issue.fixed_version_id
+ issue.project_id = 3
+ assert_nil issue.fixed_version_id
+ issue.fixed_version_id = 2
+ assert !issue.save
+ assert_include 'Target version is not included in the list', issue.errors.full_messages
+ end
+
+ def test_should_keep_shared_version_when_changing_project
+ Version.find(2).update_attribute :sharing, 'tree'
+
+ issue = Issue.find(2)
+ assert_equal 2, issue.fixed_version_id
+ issue.project_id = 3
+ assert_equal 2, issue.fixed_version_id
+ assert issue.save
+ end
+
def test_allowed_target_projects_on_move_should_include_projects_with_issue_tracking_enabled
assert_include Project.find(2), Issue.allowed_target_projects_on_move(User.find(2))
end