From 2828f81d2a41f46b89e13dc057b982f27aeee547 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 1 Jul 2022 12:08:08 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/mailers/emails/admin_notification_spec.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'spec/mailers') 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 -- cgit v1.2.3