summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-09-03 01:21:11 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-09-03 01:21:11 +0000
commit609faba6a3d326fe8d2ebe3f66d2f31da3faa77f (patch)
treeabce7f997ac5bfec019efff58fbd39a3d3af4c5c /test
parentcd1e094ce8bc42836f1a13de52040a1b969a82a3 (diff)
downloadredmine-609faba6a3d326fe8d2ebe3f66d2f31da3faa77f.tar.gz
redmine-609faba6a3d326fe8d2ebe3f66d2f31da3faa77f.zip
Allow referencing issue numbers in brackets. This style is used by other
bug trackers. Examples: * "[#nnn] Worked on this issue" * "[#nnn, #mmm] Worked on these" * "[#nnn #mmm] Working some more" git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2854 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/changeset_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb
index e5dc6d73f..51d8b7452 100644
--- a/test/unit/changeset_test.rb
+++ b/test/unit/changeset_test.rb
@@ -53,6 +53,28 @@ class ChangesetTest < Test::Unit::TestCase
assert_equal [1], c.issue_ids.sort
end
+ def test_ref_keywords_allow_brackets_around_a_issue_number
+ Setting.commit_ref_keywords = '*'
+
+ c = Changeset.new(:repository => Project.find(1).repository,
+ :committed_on => Time.now,
+ :comments => '[#1] Worked on this issue')
+ c.scan_comment_for_issue_ids
+
+ assert_equal [1], c.issue_ids.sort
+ end
+
+ def test_ref_keywords_allow_brackets_around_multiple_issue_numbers
+ Setting.commit_ref_keywords = '*'
+
+ c = Changeset.new(:repository => Project.find(1).repository,
+ :committed_on => Time.now,
+ :comments => '[#1 #2, #3] Worked on these')
+ c.scan_comment_for_issue_ids
+
+ assert_equal [1,2,3], c.issue_ids.sort
+ end
+
def test_previous
changeset = Changeset.find_by_revision('3')
assert_equal Changeset.find_by_revision('2'), changeset.previous