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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-01 15:08:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-01 15:08:08 +0300
commit2828f81d2a41f46b89e13dc057b982f27aeee547 (patch)
tree742120cc334d018efe38a3974fd59a67869acc6d /spec/mailers
parent4def415fbf45e0693b17ea418d378d62ab03a146 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/emails/admin_notification_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/mailers/emails/admin_notification_spec.rb b/spec/mailers/emails/admin_notification_spec.rb
index a233be86a83..bfd07f1d438 100644
--- a/spec/mailers/emails/admin_notification_spec.rb
+++ b/spec/mailers/emails/admin_notification_spec.rb
@@ -18,12 +18,14 @@ RSpec.describe Emails::AdminNotification do
let(:max_project_downloads) { 5 }
let(:time_period) { 600 }
+ let(:group) { nil }
subject do
Notify.user_auto_banned_email(
admin.id, user.id,
max_project_downloads: max_project_downloads,
- within_seconds: time_period
+ within_seconds: time_period,
+ group: group
)
end
@@ -45,6 +47,10 @@ RSpec.describe Emails::AdminNotification do
is_expected.to have_body_text user.name
end
+ it 'includes the scope of the ban' do
+ is_expected.to have_body_text "banned from your GitLab instance"
+ end
+
it 'includes the reason' do
is_expected.to have_body_text "due to them downloading more than 5 project repositories within 10 minutes"
end
@@ -60,5 +66,13 @@ RSpec.describe Emails::AdminNotification do
it 'includes the email reason' do
is_expected.to have_body_text "You're receiving this email because of your account on localhost"
end
+
+ context 'when scoped to a group' do
+ let(:group) { create(:group) }
+
+ it 'includes the scope of the ban' do
+ is_expected.to have_body_text "banned from your group (#{group.name})"
+ end
+ end
end
end