summaryrefslogtreecommitdiffstats
path: root/test/object_helpers.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-10-13 07:37:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-10-13 07:37:49 +0000
commitb6cb7aa8e3b98db4095a1869d1ce51aefaf308db (patch)
treef0b496dd9b19c52b1c499af33802c229d570862a /test/object_helpers.rb
parentb8aa4da28a1e61d3d14e296cddd3584d505da3c3 (diff)
downloadredmine-b6cb7aa8e3b98db4095a1869d1ce51aefaf308db.tar.gz
redmine-b6cb7aa8e3b98db4095a1869d1ce51aefaf308db.zip
Ability to define commit keywords per tracker (#7590).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12208 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r--test/object_helpers.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb
index 2f7559249..9cb0916f7 100644
--- a/test/object_helpers.rb
+++ b/test/object_helpers.rb
@@ -166,4 +166,16 @@ module ObjectHelpers
field.save!
field
end
+
+ def Changeset.generate!(attributes={})
+ @generated_changeset_rev ||= '123456'
+ @generated_changeset_rev.succ!
+ changeset = new(attributes)
+ changeset.repository ||= Project.find(1).repository
+ changeset.revision ||= @generated_changeset_rev
+ changeset.committed_on ||= Time.now
+ yield changeset if block_given?
+ changeset.save!
+ changeset
+ end
end