summaryrefslogtreecommitdiffstats
path: root/test/object_helpers.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-04-28 03:45:23 +0000
committerGo MAEDA <maeda@farend.jp>2018-04-28 03:45:23 +0000
commitea562ffa435301a73e0838f2563a6c868799c2a0 (patch)
tree9e1965c52228289378c16f6cf2a09ae981cfbc03 /test/object_helpers.rb
parentb1781507617d9386c8545a28941fac163afd50fa (diff)
downloadredmine-ea562ffa435301a73e0838f2563a6c868799c2a0.tar.gz
redmine-ea562ffa435301a73e0838f2563a6c868799c2a0.zip
Allow to copy documents along with projects (#26621).
Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@17314 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r--test/object_helpers.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb
index ce38356a9..b7d2eac93 100644
--- a/test/object_helpers.rb
+++ b/test/object_helpers.rb
@@ -227,6 +227,14 @@ module ObjectHelpers
query
end
+ def Document.generate!(attributes={})
+ document = new(attributes)
+ document.title = "Generated document" if document.title.blank?
+ document.category ||= DocumentCategory.find(1)
+ document.save!
+ document
+ end
+
def generate_import(fixture_name='import_issues.csv')
import = IssueImport.new
import.user_id = 2