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:
authorBrett Walker <bwalker@gitlab.com>2019-08-15 20:37:36 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-08-15 20:37:36 +0300
commit3489dc3d7277bf478f68e1b3e0353b702f652acc (patch)
tree896dc6ef08d8347e992365594ce7c4b0d49e6ee4 /spec/services/groups
parent23754943a7ec119f123694a93c79fc07c32b7ba5 (diff)
Allow disabling group/project email notifications
- 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/services/groups')
-rw-r--r--spec/services/groups/update_service_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/groups/update_service_spec.rb b/spec/services/groups/update_service_spec.rb
index 5d4576139f7..12e9c2b2f3a 100644
--- a/spec/services/groups/update_service_spec.rb
+++ b/spec/services/groups/update_service_spec.rb
@@ -86,6 +86,7 @@ describe Groups::UpdateService do
context "unauthorized visibility_level validation" do
let!(:service) { described_class.new(internal_group, user, visibility_level: 99) }
+
before do
internal_group.add_user(user, Gitlab::Access::MAINTAINER)
end
@@ -96,6 +97,20 @@ describe Groups::UpdateService do
end
end
+ context 'when updating #emails_disabled' do
+ let(:service) { described_class.new(internal_group, user, emails_disabled: true) }
+
+ it 'updates the attribute' do
+ internal_group.add_user(user, Gitlab::Access::OWNER)
+
+ expect { service.execute }.to change { internal_group.emails_disabled }.to(true)
+ end
+
+ it 'does not update when not group owner' do
+ expect { service.execute }.not_to change { internal_group.emails_disabled }
+ end
+ end
+
context 'rename group' do
let!(:service) { described_class.new(internal_group, user, path: SecureRandom.hex) }