From d651b93eff58c12b10b152aa95d2f9a875885c70 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 31 Jan 2014 18:13:42 +0000 Subject: Adds some test helpers to cleanup tests. git-svn-id: http://svn.redmine.org/redmine/trunk@12746 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/object_helpers.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/object_helpers.rb') 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 -- cgit v1.2.3