summaryrefslogtreecommitdiffstats
path: root/test/object_helpers.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-01-31 18:13:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-01-31 18:13:42 +0000
commitd651b93eff58c12b10b152aa95d2f9a875885c70 (patch)
tree408c5c7cc26d6958ba28f314e2b2caaf77f867f2 /test/object_helpers.rb
parent888823a449d9694060a22c09d8d73b2f652e62bb (diff)
downloadredmine-d651b93eff58c12b10b152aa95d2f9a875885c70.tar.gz
redmine-d651b93eff58c12b10b152aa95d2f9a875885c70.zip
Adds some test helpers to cleanup tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@12746 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r--test/object_helpers.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb
index 9cb0916f7..1f58baf9e 100644
--- a/test/object_helpers.rb
+++ b/test/object_helpers.rb
@@ -179,3 +179,16 @@ module ObjectHelpers
changeset
end
end
+
+module IssueObjectHelpers
+ def close!
+ self.status = IssueStatus.where(:is_closed => true).first
+ save!
+ end
+
+ def generate_child!(attributes={})
+ Issue.generate!(attributes.merge(:parent_issue_id => self.id))
+ end
+end
+
+Issue.send :include, IssueObjectHelpers