summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-02 18:09:37 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-02 18:09:37 +0000
commitd02f6a8e32d1e09e5303d36f09788a2d19ac413a (patch)
treea097d50913117025ded4f0d3a32a304470d1be00 /test
parent3dc73dcb88473139bdf9f2a3b95c5b2f9df8875f (diff)
downloadredmine-d02f6a8e32d1e09e5303d36f09788a2d19ac413a.tar.gz
redmine-d02f6a8e32d1e09e5303d36f09788a2d19ac413a.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/unit/changeset_test.rb30
1 files changed, 30 insertions, 0 deletions
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