diff options
author | Mark Chao <mchao@gitlab.com> | 2018-07-23 10:42:19 +0800 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-08-14 14:59:29 +0800 |
commit | 8411d1cffc05171e82d727d883f03e279c8e9e05 (patch) | |
tree | b09d87417123465509e43306dbba0da3d2abf640 /spec/controllers/notification_settings_controller_spec.rb | |
parent | bea52d827e895c9261b3b1e01980832832f7c82a (diff) | |
download | gitlab-ce-8411d1cffc05171e82d727d883f03e279c8e9e05.tar.gz |
Add email_events to replace EMAIL_EVENTS because it needs to be dynamic,
allowing override for EE.
Diffstat (limited to 'spec/controllers/notification_settings_controller_spec.rb')
-rw-r--r-- | spec/controllers/notification_settings_controller_spec.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/controllers/notification_settings_controller_spec.rb b/spec/controllers/notification_settings_controller_spec.rb index e133950e684..a3356a86d4b 100644 --- a/spec/controllers/notification_settings_controller_spec.rb +++ b/spec/controllers/notification_settings_controller_spec.rb @@ -21,10 +21,11 @@ describe NotificationSettingsController do end context 'when authorized' do + let(:notification_setting) { user.notification_settings_for(source) } let(:custom_events) do events = {} - NotificationSetting::EMAIL_EVENTS.each do |event| + NotificationSetting.email_events(source).each do |event| events[event.to_s] = true end @@ -36,7 +37,7 @@ describe NotificationSettingsController do end context 'for projects' do - let(:notification_setting) { user.notification_settings_for(project) } + let(:source) { project } it 'creates notification setting' do post :create, @@ -67,7 +68,7 @@ describe NotificationSettingsController do end context 'for groups' do - let(:notification_setting) { user.notification_settings_for(group) } + let(:source) { group } it 'creates notification setting' do post :create, @@ -145,7 +146,7 @@ describe NotificationSettingsController do let(:custom_events) do events = {} - NotificationSetting::EMAIL_EVENTS.each do |event| + notification_setting.email_events.each do |event| events[event] = "true" end end |