summaryrefslogtreecommitdiff
path: root/spec/mailers
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2017-11-09 17:59:39 -0200
committerFelipe Artur <felipefac@gmail.com>2017-11-13 12:39:01 -0200
commit5dd2862195f00e19ee9dccc126d01a8d2c484de0 (patch)
tree638156b4cc45c4e603cc70898912d85ff10b6378 /spec/mailers
parent1bf689563bfde933cd3e8d3fb58cb36c1a45d3af (diff)
downloadgitlab-ce-5dd2862195f00e19ee9dccc126d01a8d2c484de0.tar.gz
Fix image diff notes email
Diffstat (limited to 'spec/mailers')
-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