Use factories to create project/group membership on specs

parent b667d834
...@@ -6,8 +6,8 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -6,8 +6,8 @@ feature 'Groups > Members > Sorting', feature: true do
let(:group) { create(:group) } let(:group) { create(:group) }
background do background do
group.add_owner(owner) create(:group_member, :owner, user: owner, group: group, created_at: 5.days.ago)
group.add_developer(developer) create(:group_member, :developer, user: developer, group: group, created_at: 3.days.ago)
login_as(owner) login_as(owner)
end end
......
...@@ -6,8 +6,8 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -6,8 +6,8 @@ feature 'Projects > Members > Sorting', feature: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
background do background do
project.team << [master, :master] create(:project_member, :master, user: master, project: project, created_at: 5.days.ago)
project.team << [developer, :developer] create(:project_member, :developer, user: developer, project: project, created_at: 3.days.ago)
login_as(master) login_as(master)
end 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