diff options
author | Marcia Ramos <virtua.creative@gmail.com> | 2018-08-16 10:17:22 +0100 |
---|---|---|
committer | Marcia Ramos <virtua.creative@gmail.com> | 2018-08-16 10:17:22 +0100 |
commit | bfc0c602072bd5b9bf73e117d0808043adc9465e (patch) | |
tree | ea55f6e86fdfdcccca9c593d5441c9d2c3efd441 /spec/controllers/notification_settings_controller_spec.rb | |
parent | 1e23577417b3e4eb06b9aba1ec174dbe78b6b9be (diff) | |
parent | 0a666b2cb1020df4b8f7b71041b6bd109b49656a (diff) | |
download | gitlab-ce-docs-processes.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into docs-processesdocs-processes
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 |