summaryrefslogtreecommitdiffstats
path: root/test/unit/changeset_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-01-31 16:25:06 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-01-31 16:25:06 +0000
commitd43c860448ce71ca3f35ac6487775deaa0dcb3c3 (patch)
tree70ae267c28cf00c3141774f20641caa074a6f353 /test/unit/changeset_test.rb
parentdf46d704e882823c30bc5cf0f2b88da8db98b47f (diff)
downloadredmine-d43c860448ce71ca3f35ac6487775deaa0dcb3c3.tar.gz
redmine-d43c860448ce71ca3f35ac6487775deaa0dcb3c3.zip
Allow commits to reference issues of parent projects and subprojects (#4674).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3357 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/changeset_test.rb')
-rw-r--r--test/unit/changeset_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb
index 02736a9a0..8d57c43ab 100644
--- a/test/unit/changeset_test.rb
+++ b/test/unit/changeset_test.rb
@@ -74,6 +74,29 @@ class ChangesetTest < ActiveSupport::TestCase
assert_equal [1,2,3], c.issue_ids.sort
end
+
+ def test_commit_referencing_a_subproject_issue
+ c = Changeset.new(:repository => Project.find(1).repository,
+ :committed_on => Time.now,
+ :comments => 'refs #5, a subproject issue')
+ c.scan_comment_for_issue_ids
+
+ assert_equal [5], c.issue_ids.sort
+ assert c.issues.first.project != c.project
+ end
+
+ def test_commit_referencing_a_parent_project_issue
+ # repository of child project
+ r = Repository::Subversion.create!(:project => Project.find(3), :url => 'svn://localhost/test')
+
+ c = Changeset.new(:repository => r,
+ :committed_on => Time.now,
+ :comments => 'refs #2, an issue of a parent project')
+ c.scan_comment_for_issue_ids
+
+ assert_equal [2], c.issue_ids.sort
+ assert c.issues.first.project != c.project
+ end
def test_previous
changeset = Changeset.find_by_revision('3')