diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-01-31 16:25:06 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-01-31 16:25:06 +0000 |
commit | d43c860448ce71ca3f35ac6487775deaa0dcb3c3 (patch) | |
tree | 70ae267c28cf00c3141774f20641caa074a6f353 /test/unit/changeset_test.rb | |
parent | df46d704e882823c30bc5cf0f2b88da8db98b47f (diff) | |
download | redmine-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.rb | 23 |
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') |