diff options
Diffstat (limited to 'spec/models/members')
-rw-r--r-- | spec/models/members/group_member_spec.rb | 7 | ||||
-rw-r--r-- | spec/models/members/project_member_spec.rb | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/spec/models/members/group_member_spec.rb b/spec/models/members/group_member_spec.rb index c6266f15340..363830d21dd 100644 --- a/spec/models/members/group_member_spec.rb +++ b/spec/models/members/group_member_spec.rb @@ -74,7 +74,8 @@ RSpec.describe GroupMember do describe '#update_two_factor_requirement' do it 'is called after creation and deletion' do user = build :user - group_member = build :group_member, user: user + group = create :group + group_member = build :group_member, user: user, group: group expect(user).to receive(:update_two_factor_requirement) @@ -151,8 +152,8 @@ RSpec.describe GroupMember do context 'when importing' do it 'does not refresh' do expect(UserProjectAccessChangedService).not_to receive(:new) - - member = build(:group_member) + group = create(:group) + member = build(:group_member, group: group) member.importing = true member.save! end diff --git a/spec/models/members/project_member_spec.rb b/spec/models/members/project_member_spec.rb index 99fc5dc14df..ad6f3ca5428 100644 --- a/spec/models/members/project_member_spec.rb +++ b/spec/models/members/project_member_spec.rb @@ -201,7 +201,7 @@ RSpec.describe ProjectMember do it 'does not refresh' do expect(AuthorizedProjectUpdate::ProjectRecalculatePerUserWorker).not_to receive(:bulk_perform_and_wait) - member = build(:project_member) + member = build(:project_member, project: project) member.importing = true member.save! end |