summaryrefslogtreecommitdiffstats
path: root/test/object_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/object_helpers.rb')
-rw-r--r--test/object_helpers.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb
index 66334f63a..2b3327961 100644
--- a/test/object_helpers.rb
+++ b/test/object_helpers.rb
@@ -60,13 +60,18 @@ module ObjectHelpers
status
end
- def Tracker.generate!(attributes={})
+ def Tracker.generate(attributes={})
@generated_tracker_name ||= 'Tracker 0'
@generated_tracker_name.succ!
tracker = Tracker.new(attributes)
tracker.name = @generated_tracker_name.dup if tracker.name.blank?
tracker.default_status ||= IssueStatus.order('position').first || IssueStatus.generate!
yield tracker if block_given?
+ tracker
+ end
+
+ def Tracker.generate!(attributes={}, &block)
+ tracker = Tracker.generate(attributes, &block)
tracker.save!
tracker
end