Projects
Create a project
group = create(:group, name: 'My Group')create(:project, :public, creator: @owner, namespace: group)
groups: - _id: my_group name: My Group
projects: - creator_id: "<%= @owner.id %>" namespace_id: "<%= my_group.id %>" traits: - public
{ "groups": [ "_id": "my_group", "name": "My Group" ], "projects": [ "creator_id": "<%= @owner.id %>", "namespace_id": "<%= my_group.id %>", "traits": [ "public" ] ]}
Project Visibility
The visibility of a project can be determined by the visibility_level
attribute.
Gotchas
Owner
You must pass the owner
attribute to the factory. Unless your seed file is creating a user,
this will usually be set to the @owner
global variable. create(:project, owner: @owner)
Top-level namespaces
By default, projects are supposed to create their top-level namespaces. Unfortunately this is a bit hit-and-miss.
You must pass the namespace
attribute to the factory