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>2021-03-15 18:09:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-15 18:09:07 +0300
commitf5c3f32975addd56fe8659f1c346d0e56f0b23d9 (patch)
tree9d6594793e656c52341a98d22d882d96d240433f /spec/mailers
parentc8b7a349bc50cff1e8ef18204042978476527b0b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/emails/service_desk_spec.rb11
-rw-r--r--spec/mailers/notify_spec.rb3
2 files changed, 12 insertions, 2 deletions
diff --git a/spec/mailers/emails/service_desk_spec.rb b/spec/mailers/emails/service_desk_spec.rb
index 7d04b373be6..cb74194020d 100644
--- a/spec/mailers/emails/service_desk_spec.rb
+++ b/spec/mailers/emails/service_desk_spec.rb
@@ -13,8 +13,13 @@ RSpec.describe Emails::ServiceDesk do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:issue) { create(:issue, project: project) }
+ let_it_be(:email) { 'someone@gitlab.com' }
let(:template) { double(content: template_content) }
+ before_all do
+ issue.issue_email_participants.create!(email: email)
+ end
+
before do
stub_const('ServiceEmailClass', Class.new(ApplicationMailer))
@@ -72,6 +77,10 @@ RSpec.describe Emails::ServiceDesk do
let(:template_content) { 'custom text' }
let(:issue) { create(:issue, project: project)}
+ before do
+ issue.issue_email_participants.create!(email: email)
+ end
+
context 'when a template is in the repository' do
let(:project) { create(:project, :custom_repo, files: { ".gitlab/service_desk_templates/#{template_key}.md" => template_content }) }
@@ -151,7 +160,7 @@ RSpec.describe Emails::ServiceDesk do
let_it_be(:note) { create(:note_on_issue, noteable: issue, project: project) }
let_it_be(:default_text) { note.note }
- subject { ServiceEmailClass.service_desk_new_note_email(issue.id, note.id) }
+ subject { ServiceEmailClass.service_desk_new_note_email(issue.id, note.id, email) }
it_behaves_like 'read template from repository', 'new_note'
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 399f6ff5576..79358d3e40c 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -1218,6 +1218,7 @@ RSpec.describe Notify do
context 'for service desk issues' do
before do
issue.update!(external_author: 'service.desk@example.com')
+ issue.issue_email_participants.create!(email: 'service.desk@example.com')
end
def expect_sender(username)
@@ -1266,7 +1267,7 @@ RSpec.describe Notify do
describe 'new note email' do
let_it_be(:first_note) { create(:discussion_note_on_issue, note: 'Hello world') }
- subject { described_class.service_desk_new_note_email(issue.id, first_note.id) }
+ subject { described_class.service_desk_new_note_email(issue.id, first_note.id, 'service.desk@example.com') }
it_behaves_like 'an unsubscribeable thread'