diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 12:08:38 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 12:08:38 +0000 |
commit | 5ad0cf26551baff8f08af8562a8d45e6ec14d71a (patch) | |
tree | 57f1a6bad31bcd11efacd3fdfb9cc92f88fb6a86 /spec/mailers | |
parent | f47c768fad17d4c876e96524f83f8306f071db66 (diff) | |
download | gitlab-ce-5ad0cf26551baff8f08af8562a8d45e6ec14d71a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/notify_spec.rb | 26 |
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 |