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>2020-08-05 21:10:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-05 21:10:10 +0300
commitea4766228b5536c83f1917d6058be913472ffa2d (patch)
tree5ebf5ea0f996be6c6908e6b631b72c33bc13e997 /spec/mailers
parent4b64dc27ae5bac20dec888431c236fef2bfdc449 (diff)
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/notify_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index e56cd488a52..9dde80f58d5 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -45,6 +45,21 @@ RSpec.describe Notify do
end
end
+ shared_examples 'it requires a group' do
+ context 'when given an deleted group' do
+ before do
+ # destroy group and group member
+ group_member.destroy!
+ group.destroy!
+ end
+
+ it 'returns NullMail type message' do
+ expect(Gitlab::AppLogger).to receive(:info)
+ expect(subject.message).to be_a(ActionMailer::Base::NullMail)
+ end
+ end
+ end
+
context 'for a project' do
shared_examples 'an assignee email' do
let(:recipient) { assignee }
@@ -1388,6 +1403,7 @@ RSpec.describe Notify do
it_behaves_like "a user cannot unsubscribe through footer link"
it_behaves_like 'appearance header and footer enabled'
it_behaves_like 'appearance header and footer not enabled'
+ it_behaves_like 'it requires a group'
it 'contains all the useful information' do
is_expected.to have_subject "Access to the #{group.name} group was granted"
@@ -1422,6 +1438,7 @@ RSpec.describe Notify do
it_behaves_like "a user cannot unsubscribe through footer link"
it_behaves_like 'appearance header and footer enabled'
it_behaves_like 'appearance header and footer not enabled'
+ it_behaves_like 'it requires a group'
it 'contains all the useful information' do
is_expected.to have_subject "Invitation to join the #{group.name} group"
@@ -1448,6 +1465,7 @@ RSpec.describe Notify do
it_behaves_like "a user cannot unsubscribe through footer link"
it_behaves_like 'appearance header and footer enabled'
it_behaves_like 'appearance header and footer not enabled'
+ it_behaves_like 'it requires a group'
it 'contains all the useful information' do
is_expected.to have_subject 'Invitation accepted'