summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-11-13 15:35:06 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-11-13 15:35:06 +0000
commit3582c6ab8e76bcb730abcc85b70d8ef4992ea322 (patch)
tree36c8c808f831010b2874d351882c8d867f89e215 /spec
parent1c116bc95f5e55360e3c3e22c96fc6a617d62c74 (diff)
parent5dd2862195f00e19ee9dccc126d01a8d2c484de0 (diff)
downloadgitlab-ce-3582c6ab8e76bcb730abcc85b70d8ef4992ea322.tar.gz
Merge branch 'issue_39238' into 'master'
Fix image diff notes email Closes #39238 See merge request gitlab-org/gitlab-ce!15299
Diffstat (limited to 'spec')
-rw-r--r--spec/mailers/notify_spec.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index c832cee965b..f942a22b6d1 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -783,7 +783,25 @@ describe Notify do
shared_examples 'an email for a note on a diff discussion' do |model|
let(:note) { create(model, author: note_author) }
- it "includes diffs with character-level highlighting" do
+ context 'when note is on image' do
+ before do
+ allow_any_instance_of(DiffDiscussion).to receive(:on_image?).and_return(true)
+ end
+
+ it 'does not include diffs with character-level highlighting' do
+ is_expected.not_to have_body_text '<span class="p">}</span></span>'
+ end
+
+ it 'ends the intro with a dot' do
+ is_expected.to have_body_text "#{note.diff_file.file_path}</a>."
+ end
+ end
+
+ it 'ends the intro with a colon' do
+ is_expected.to have_body_text "#{note.diff_file.file_path}</a>:"
+ end
+
+ it 'includes diffs with character-level highlighting' do
is_expected.to have_body_text '<span class="p">}</span></span>'
end