Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2018-07-23 05:42:19 +0300
committerMark Chao <mchao@gitlab.com>2018-08-14 09:59:29 +0300
commit8411d1cffc05171e82d727d883f03e279c8e9e05 (patch)
treeb09d87417123465509e43306dbba0da3d2abf640 /spec/controllers/notification_settings_controller_spec.rb
parentbea52d827e895c9261b3b1e01980832832f7c82a (diff)
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.rb9
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