summaryrefslogtreecommitdiffstats
path: root/test/object_daddy_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/object_daddy_helpers.rb')
-rw-r--r--test/object_daddy_helpers.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/object_daddy_helpers.rb b/test/object_daddy_helpers.rb
index 7b144b18f..c94ada229 100644
--- a/test/object_daddy_helpers.rb
+++ b/test/object_daddy_helpers.rb
@@ -13,6 +13,11 @@ module ObjectDaddyHelpers
User.spawn(attributes)
end
+ def User.add_to_project(user, project, roles)
+ roles = [roles] unless roles.is_a?(Array)
+ Member.generate!(:principal => user, :project => project, :roles => roles)
+ end
+
# Generate the default Query
def Query.generate_default!(attributes={})
query = Query.spawn(attributes)