Skip to content

Projects

Create a project

group = create(:group, name: 'My Group')
create(:project, :public, creator: @owner, namespace: group)

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