Use factories to create project/group membership on specs

parent b667d834
......@@ -6,8 +6,8 @@ feature 'Groups > Members > Sorting', feature: true do
let(:group) { create(:group) }
background do
group.add_owner(owner)
group.add_developer(developer)
create(:group_member, :owner, user: owner, group: group, created_at: 5.days.ago)
create(:group_member, :developer, user: developer, group: group, created_at: 3.days.ago)
login_as(owner)
end
......
......@@ -6,8 +6,8 @@ feature 'Projects > Members > Sorting', feature: true do
let(:project) { create(:empty_project) }
background do
project.team << [master, :master]
project.team << [developer, :developer]
create(:project_member, :master, user: master, project: project, created_at: 5.days.ago)
create(:project_member, :developer, user: developer, project: project, created_at: 3.days.ago)
login_as(master)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment