diff options
author | Patrick Derichs <pderichs@gitlab.com> | 2019-04-14 17:21:12 +0200 |
---|---|---|
committer | Patrick Derichs <pderichs@gitlab.com> | 2019-04-16 13:45:49 +0200 |
commit | 47f4990d8f993b299944d122200339ae381950b5 (patch) | |
tree | 83a1163b25545299d4548160990e64d78df748cc | |
parent | 141ae689a981cc30d1f13f003e5386c077eee1d1 (diff) | |
download | gitlab-ce-fix-extra-emails-for-custom-notifications.tar.gz |
Refactor spec so it creates the users explicitly on the groupfix-extra-emails-for-custom-notifications
-rw-r--r-- | spec/services/notification_service_spec.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 845aa87d3ff..4b40c86574f 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -644,18 +644,14 @@ describe NotificationService, :mailer do end describe 'Participating project notification settings have priority over group and global settings if available' do - let(:group) { create(:group) } + let!(:group) { create(:group) } + let!(:maintainer) { group.add_owner(create(:user, username: 'maintainer')).user } + let!(:user1) { group.add_developer(create(:user, username: 'user_with_project_and_custom_setting')).user } + let(:project) { create(:project, :public, namespace: group) } - let(:another_project) { create(:project, :public, namespace: group) } let(:issue) { create :issue, project: project, assignees: [assignee], description: '' } - let(:maintainer) { create(:user, username: 'maintainer') } - let(:user1) { create(:user, username: 'user_with_project_and_custom_setting') } - before do - project.add_maintainer(maintainer) - project.save! - reset_delivered_emails! create_notification_setting(user1, project, :participating) |