From d02f6a8e32d1e09e5303d36f09788a2d19ac413a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 2 Feb 2012 18:09:37 +0000 Subject: Adds a setting that allows to reference/fix issues of all projects (#3087). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8750 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/changeset_test.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test') diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb index cee7d4fd6..9b929a0fc 100644 --- a/test/unit/changeset_test.rb +++ b/test/unit/changeset_test.rb @@ -192,6 +192,36 @@ class ChangesetTest < ActiveSupport::TestCase assert c.issues.first.project != c.project end + def test_commit_referencing_a_project_with_commit_cross_project_ref_disabled + r = Repository::Subversion.create!( + :project => Project.find(3), + :url => 'svn://localhost/test') + + with_settings :commit_cross_project_ref => '0' do + c = Changeset.new(:repository => r, + :committed_on => Time.now, + :comments => 'refs #4, an issue of a different project', + :revision => '12345') + assert c.save + assert_equal [], c.issue_ids + end + end + + def test_commit_referencing_a_project_with_commit_cross_project_ref_enabled + r = Repository::Subversion.create!( + :project => Project.find(3), + :url => 'svn://localhost/test') + + with_settings :commit_cross_project_ref => '1' do + c = Changeset.new(:repository => r, + :committed_on => Time.now, + :comments => 'refs #4, an issue of a different project', + :revision => '12345') + assert c.save + assert_equal [4], c.issue_ids + end + end + def test_text_tag_revision c = Changeset.new(:revision => '520') assert_equal 'r520', c.text_tag -- cgit v1.2.3