summaryrefslogtreecommitdiffstats
path: root/test/unit/changeset_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-11-08 21:41:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-11-08 21:41:02 +0000
commit9fc0d230c8887fbaa879544a1d1c00890c2732a8 (patch)
tree0b6b43d9dc9c8ed50d97629b863c34f793679e49 /test/unit/changeset_test.rb
parent328e0767228bbd1200bb33134fee82c97a28255b (diff)
downloadredmine-9fc0d230c8887fbaa879544a1d1c00890c2732a8.tar.gz
redmine-9fc0d230c8887fbaa879544a1d1c00890c2732a8.zip
Adds a test for #21100.
git-svn-id: http://svn.redmine.org/redmine/trunk@14855 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/changeset_test.rb')
-rw-r--r--test/unit/changeset_test.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb
index 6ba02aa56..7d44996c2 100644
--- a/test/unit/changeset_test.rb
+++ b/test/unit/changeset_test.rb
@@ -215,7 +215,7 @@ class ChangesetTest < ActiveSupport::TestCase
end
end
- def test_update_keywords_with_multiple_rules_should_match_tracker
+ def test_update_keywords_with_multiple_rules_for_the_same_keyword_should_match_tracker
with_settings :commit_update_keywords => [
{'keywords' => 'fixes', 'status_id' => '5', 'if_tracker_id' => '2'},
{'keywords' => 'fixes', 'status_id' => '3', 'if_tracker_id' => ''}
@@ -229,6 +229,24 @@ class ChangesetTest < ActiveSupport::TestCase
end
end
+ def test_update_keywords_with_multiple_rules_for_the_same_tracker_should_match_keyword
+ with_settings :commit_update_keywords => [
+ {'keywords' => 'Fixes, Closes', 'status_id' => '5', 'done_ratio' => '100', 'if_tracker_id' => '2'},
+ {'keywords' => 'Testing', 'status_id' => '3', 'done_ratio' => '90', 'if_tracker_id' => '2'}
+ ] do
+
+ issue1 = Issue.generate!(:tracker_id => 2)
+ issue2 = Issue.generate!(:tracker_id => 2)
+ Changeset.generate!(:comments => "Testing ##{issue1.id}, Fixes ##{issue2.id}")
+ issue1.reload
+ assert_equal 3, issue1.status_id
+ assert_equal 90, issue1.done_ratio
+ issue2.reload
+ assert_equal 5, issue2.status_id
+ assert_equal 100, issue2.done_ratio
+ end
+ end
+
def test_update_keywords_with_multiple_rules_and_no_match
with_settings :commit_update_keywords => [
{'keywords' => 'fixes', 'status_id' => '5', 'if_tracker_id' => '2'},