summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-05-31 17:51:46 -0300
committerFelipe Artur <felipefac@gmail.com>2016-06-15 11:47:50 -0300
commit89a2c8730b5d1f69703b0879d5b6b7bd5d766695 (patch)
tree456c480b86f74c4f47f334def338dbba527e9031 /spec/controllers
parent8bfbafbb6b2166d3709187cf6b1cb7ff5f627d52 (diff)
downloadgitlab-ce-89a2c8730b5d1f69703b0879d5b6b7bd5d766695.tar.gz
Implement custom notification level options
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/notification_settings_controller_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/controllers/projects/notification_settings_controller_spec.rb b/spec/controllers/projects/notification_settings_controller_spec.rb
index c5d17d97ec9..a726f70a64a 100644
--- a/spec/controllers/projects/notification_settings_controller_spec.rb
+++ b/spec/controllers/projects/notification_settings_controller_spec.rb
@@ -33,6 +33,25 @@ describe Projects::NotificationSettingsController do
expect(response.status).to eq 200
end
+
+ context 'and setting custom notification setting' do
+ let(:custom_events) do
+ events = {}
+
+ NotificationSetting::EMAIL_EVENTS.each do |event|
+ events[event] = "true"
+ end
+ end
+
+ it 'returns success' do
+ put :update,
+ namespace_id: project.namespace.to_param,
+ project_id: project.to_param,
+ notification_setting: { level: :participating, events: custom_events }
+
+ expect(response.status).to eq 200
+ end
+ end
end
context 'not authorized' do