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-01-23 15:08:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-23 15:08:38 +0300
commit5ad0cf26551baff8f08af8562a8d45e6ec14d71a (patch)
tree57f1a6bad31bcd11efacd3fdfb9cc92f88fb6a86 /spec/mailers
parentf47c768fad17d4c876e96524f83f8306f071db66 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/notify_spec.rb26
1 files changed, 22 insertions, 4 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index e4a7d62eb02..19b15a6c6e2 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -686,7 +686,7 @@ describe Notify do
let(:project_snippet) { create(:project_snippet, project: project) }
let(:project_snippet_note) { create(:note_on_project_snippet, project: project, noteable: project_snippet) }
- subject { described_class.note_project_snippet_email(project_snippet_note.author_id, project_snippet_note.id) }
+ subject { described_class.note_snippet_email(project_snippet_note.author_id, project_snippet_note.id) }
it_behaves_like 'appearance header and footer enabled'
it_behaves_like 'appearance header and footer not enabled'
@@ -696,10 +696,20 @@ describe Notify do
end
it_behaves_like 'a user cannot unsubscribe through footer link'
- it 'has the correct subject and body' do
+ it 'has the correct subject' do
is_expected.to have_referable_subject(project_snippet, reply: true)
+ end
+
+ it 'has the correct body' do
is_expected.to have_body_text project_snippet_note.note
end
+
+ it 'links to the project snippet' do
+ target_url = project_snippet_url(project,
+ project_snippet_note.noteable,
+ { anchor: "note_#{project_snippet_note.id}" })
+ is_expected.to have_body_text target_url
+ end
end
describe 'project was moved' do
@@ -1650,15 +1660,23 @@ describe Notify do
let(:personal_snippet) { create(:personal_snippet) }
let(:personal_snippet_note) { create(:note_on_personal_snippet, noteable: personal_snippet) }
- subject { described_class.note_personal_snippet_email(personal_snippet_note.author_id, personal_snippet_note.id) }
+ subject { described_class.note_snippet_email(personal_snippet_note.author_id, personal_snippet_note.id) }
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 'has the correct subject and body' do
+ it 'has the correct subject' do
is_expected.to have_referable_subject(personal_snippet, reply: true)
+ end
+
+ it 'has the correct body' do
is_expected.to have_body_text personal_snippet_note.note
end
+
+ it 'links to the personal snippet' do
+ target_url = gitlab_snippet_url(personal_snippet_note.noteable)
+ is_expected.to have_body_text target_url
+ end
end
end