summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-08-14 16:59:02 -0700
committerMichael Kozono <mkozono@gmail.com>2017-08-15 09:05:31 -0700
commite9939a0ed263886fc7e08c1451ea635703064b8a (patch)
tree0e390bc3ef75221d8a30c806590c1846d8288f54
parent5769a8015a896d8bab168711a38aab6c61244bdc (diff)
downloadgitlab-ce-mk-add-member-request-tables-30704.tar.gz
Fix tests of access granted email triggersmk-add-member-request-tables-30704
Since Member is now always created on “Approval” of an access request, and since we send the “Access granted” email when Member is created, we no longer need to send the email in an after_accept_request hook.
-rw-r--r--spec/models/members/group_member_spec.rb10
-rw-r--r--spec/models/members/project_member_spec.rb6
2 files changed, 2 insertions, 14 deletions
diff --git a/spec/models/members/group_member_spec.rb b/spec/models/members/group_member_spec.rb
index 5a3b5b1f517..722efa32692 100644
--- a/spec/models/members/group_member_spec.rb
+++ b/spec/models/members/group_member_spec.rb
@@ -59,16 +59,6 @@ describe GroupMember do
end
end
- describe '#after_accept_request' do
- it 'calls NotificationService.accept_group_access_request' do
- member = create(:group_member, user: build(:user), requested_at: Time.now)
-
- expect_any_instance_of(NotificationService).to receive(:new_group_member)
-
- member.__send__(:after_accept_request)
- end
- end
-
describe '#real_source_type' do
subject { create(:group_member).real_source_type }
diff --git a/spec/models/members/project_member_spec.rb b/spec/models/members/project_member_spec.rb
index fa3e80ba062..3be33a82c09 100644
--- a/spec/models/members/project_member_spec.rb
+++ b/spec/models/members/project_member_spec.rb
@@ -147,13 +147,11 @@ describe ProjectMember do
end
describe 'notifications' do
- describe '#after_accept_request' do
+ describe '#after_create (e.g. approval of an access request)' do
it 'calls NotificationService.new_project_member' do
- member = create(:project_member, user: create(:user), requested_at: Time.now)
-
expect_any_instance_of(NotificationService).to receive(:new_project_member)
- member.__send__(:after_accept_request)
+ create(:project_member, user: create(:user))
end
end
end