diff --git a/spec/features/groups/members/sorting_spec.rb b/spec/features/groups/members/sorting_spec.rb index 5904025d978..42ba8b614a3 100644 --- a/spec/features/groups/members/sorting_spec.rb +++ b/spec/features/groups/members/sorting_spec.rb @@ -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 diff --git a/spec/features/projects/members/sorting_spec.rb b/spec/features/projects/members/sorting_spec.rb index 61d3a112b93..3754dfa658d 100644 --- a/spec/features/projects/members/sorting_spec.rb +++ b/spec/features/projects/members/sorting_spec.rb @@ -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