Use factories to create project/group membership on specs
This commit is contained in:
parent
b667d834bc
commit
0ef2c8dfbe
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue