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.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/object_helpers.rb b/test/object_helpers.rb
index 82d8d20fc..905ab0998 100644
--- a/test/object_helpers.rb
+++ b/test/object_helpers.rb
@@ -39,7 +39,10 @@ module ObjectHelpers
project
end
- def Project.generate_with_parent!(parent, attributes={})
+ def Project.generate_with_parent!(*args)
+ attributes = args.last.is_a?(Hash) ? args.pop : {}
+ parent = args.size > 0 ? args.first : Project.generate!
+
project = Project.generate!(attributes) do |p|
p.parent = parent
end