summaryrefslogtreecommitdiff
path: root/spec/features/groups
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2019-08-17 05:56:48 +0000
committerPaul Slaughter <pslaughter@gitlab.com>2019-08-17 05:56:48 +0000
commit9be16e1f495655e68bc980fced9a8075223ccccf (patch)
treec3ac8db7b555e7b4aef5d1d9f12eb08ad17dd5dd /spec/features/groups
parent9eabc0d6fc268023db13e8dad315f99f4fe1a6da (diff)
downloadgitlab-ce-9be16e1f495655e68bc980fced9a8075223ccccf.tar.gz
UI for disabling group/project email notification
- Adds UI to configure in group and project settings - Removes notification configuration for users when disabled at group or project level
Diffstat (limited to 'spec/features/groups')
-rw-r--r--spec/features/groups/show_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb
index 942a9889488..bcaed2a5f18 100644
--- a/spec/features/groups/show_spec.rb
+++ b/spec/features/groups/show_spec.rb
@@ -161,4 +161,27 @@ describe 'Group show page' do
expect(find('.group-row:nth-child(3) .namespace-title > a')).to have_content(project3.title)
end
end
+
+ context 'notification button', :js do
+ let(:maintainer) { create(:user) }
+ let!(:project) { create(:project, namespace: group) }
+
+ before do
+ group.add_maintainer(maintainer)
+ sign_in(maintainer)
+ end
+
+ it 'is enabled by default' do
+ visit path
+
+ expect(page).to have_selector('.notifications-btn:not(.disabled)', visible: true)
+ end
+
+ it 'is disabled if emails are disabled' do
+ group.update_attribute(:emails_disabled, true)
+ visit path
+
+ expect(page).to have_selector('.notifications-btn.disabled', visible: true)
+ end
+ end
end