summaryrefslogtreecommitdiff
path: root/spec/controllers/groups/notification_settings_controller_spec.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-11 19:54:13 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-12 12:10:59 -0300
commitaabb466e5b35477b39cc57642083df361cd5d112 (patch)
tree735e2f6e111f88546b278555969c0cb3bfcacedc /spec/controllers/groups/notification_settings_controller_spec.rb
parentef22b76b732c2bf4ce52b8a73570ac2921f9caa4 (diff)
downloadgitlab-ce-aabb466e5b35477b39cc57642083df361cd5d112.tar.gz
Improve specs for group/project notification controllerdecouple-member-notification
Diffstat (limited to 'spec/controllers/groups/notification_settings_controller_spec.rb')
-rw-r--r--spec/controllers/groups/notification_settings_controller_spec.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/controllers/groups/notification_settings_controller_spec.rb b/spec/controllers/groups/notification_settings_controller_spec.rb
index 3572535d61c..0786e45515a 100644
--- a/spec/controllers/groups/notification_settings_controller_spec.rb
+++ b/spec/controllers/groups/notification_settings_controller_spec.rb
@@ -2,16 +2,31 @@ require 'spec_helper'
describe Groups::NotificationSettingsController do
let(:group) { create(:group) }
+ let(:user) { create(:user) }
describe '#update' do
context 'when not authorized' do
it 'redirects to sign in page' do
put :update,
group_id: group.to_param,
- notification_setting: { level: NotificationSetting.levels[:participating] }
+ notification_setting: { level: :participating }
expect(response).to redirect_to(new_user_session_path)
end
end
+
+ context 'when authorized' do
+ before do
+ sign_in(user)
+ end
+
+ it 'returns success' do
+ put :update,
+ group_id: group.to_param,
+ notification_setting: { level: :participating }
+
+ expect(response.status).to eq 200
+ end
+ end
end
end