summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-20 12:07:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-20 12:07:28 +0000
commit99f9aea80a2bc43cdfc2933728f0ab72d7bf99d5 (patch)
tree840e11fa2d5d72dac774069417e1ad30ce895072 /test
parentdeb182337d14872c5481059382459f5c21502162 (diff)
downloadredmine-99f9aea80a2bc43cdfc2933728f0ab72d7bf99d5.tar.gz
redmine-99f9aea80a2bc43cdfc2933728f0ab72d7bf99d5.zip
* Referencing issues in commit messages: enter * in 'Referencing keywords' to link any issue id without using keywords.
* Updated Polish translation (Mariusz Olejnik). git-svn-id: http://redmine.rubyforge.org/svn/trunk@918 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/changeset_test.rb42
-rw-r--r--test/unit/repository_test.rb2
2 files changed, 43 insertions, 1 deletions
diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb
new file mode 100644
index 000000000..ee53f18ff
--- /dev/null
+++ b/test/unit/changeset_test.rb
@@ -0,0 +1,42 @@
+# redMine - project management software
+# Copyright (C) 2006-2007 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require File.dirname(__FILE__) + '/../test_helper'
+
+class ChangesetTest < Test::Unit::TestCase
+ fixtures :projects, :repositories, :issues, :issue_statuses, :changesets, :changes, :issue_categories, :enumerations, :custom_fields, :custom_values, :users, :members, :trackers
+
+ def setup
+ end
+
+ def test_ref_keywords_any
+ Setting.commit_fix_status_id = IssueStatus.find(:first, :conditions => ["is_closed = ?", true]).id
+ Setting.commit_fix_done_ratio = '90'
+ Setting.commit_ref_keywords = '*'
+ Setting.commit_fix_keywords = 'fixes , closes'
+
+ c = Changeset.new(:repository => Project.find(1).repository,
+ :committed_on => Time.now,
+ :comments => 'New commit (#2). Fixes #1')
+ c.scan_comment_for_issue_ids
+
+ assert_equal [1, 2], c.issue_ids.sort
+ fixed = Issue.find(1)
+ assert fixed.closed?
+ assert_equal 90, fixed.done_ratio
+ end
+end
diff --git a/test/unit/repository_test.rb b/test/unit/repository_test.rb
index b802403f5..843b0b42c 100644
--- a/test/unit/repository_test.rb
+++ b/test/unit/repository_test.rb
@@ -68,7 +68,7 @@ class RepositoryTest < Test::Unit::TestCase
COMMENT
changeset = Changeset.new(
:comments => comment, :commit_date => Time.now, :revision => 0, :scmid => 'f39b7922fb3c',
- :committer => 'foo <foo@example.com>', :committed_on => Time.now, :repository_id => repository )
+ :committer => 'foo <foo@example.com>', :committed_on => Time.now, :repository => repository )
assert( changeset.save )
assert_not_equal( comment, changeset.comments )
assert_equal( 'This is a loooooooooooooooooooooooooooong comment', changeset.comments )