diff options
author | http://jneen.net/ <jneen@jneen.net> | 2017-08-09 23:48:51 -0700 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2017-08-11 16:02:06 -0700 |
commit | b0600b01563a7bfb09ae01f70c0f052c200b8f4c (patch) | |
tree | bf3aa315fba761bc2187bf4c50658967e1a8dbcf /spec/services/notification_service_spec.rb | |
parent | b5809822b13ac916ef3ea7691757725be147ade8 (diff) | |
download | gitlab-ce-b0600b01563a7bfb09ae01f70c0f052c200b8f4c.tar.gz |
add a spec for new_group_member
Diffstat (limited to 'spec/services/notification_service_spec.rb')
-rw-r--r-- | spec/services/notification_service_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index bed74b4a900..63639fd7db1 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -472,6 +472,36 @@ describe NotificationService, :mailer do end end + describe 'Members' do + let(:group) { create(:group) } + let(:project) { create(:project, :public, namespace: group) } + let(:added_user) { create(:user) } + + def create_member! + GroupMember.create( + group: group, + user: added_user, + access_level: Gitlab::Access::GUEST + ) + end + + it 'sends a notification' do + create_member! + should_only_email(added_user) + end + + describe 'when notifications are disabled' do + before do + create_global_setting_for(added_user, :disabled) + end + + it 'does not send a notification' do + create_member! + should_not_email_anyone + end + end + end + describe 'Issues' do let(:group) { create(:group) } let(:project) { create(:project, :public, namespace: group) } |