From ff5dace7bbb7674ef6fc3d630daf9c3ce7cc8bfa Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 20 Dec 2018 15:26:07 +0100 Subject: [PATCH] Always use colon at end of discussion notification email headline --- app/views/notify/_note_email.html.haml | 10 +++------- spec/mailers/notify_spec.rb | 12 ++---------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/app/views/notify/_note_email.html.haml b/app/views/notify/_note_email.html.haml index 1fbae2f64ed..83c7f548975 100644 --- a/app/views/notify/_note_email.html.haml +++ b/app/views/notify/_note_email.html.haml @@ -4,17 +4,13 @@ - note_style = local_assigns.fetch(:note_style, "") - discussion = note.discussion if note.part_of_discussion? -- diff_discussion = discussion&.diff_discussion? -- on_image = discussion.on_image? if diff_discussion - if discussion - - phrase_end_char = on_image ? "." : ":" - %p{ style: "color: #777777;" } - = succeed phrase_end_char do + = succeed ':' do = link_to note.author_name, user_url(note.author) - - if diff_discussion + - if discussion&.diff_discussion? - if discussion.new_discussion? started a new discussion - else @@ -31,7 +27,7 @@ %p.details #{link_to note.author_name, user_url(note.author)} commented: -- if diff_discussion && !on_image +- if discussion&.diff_discussion? && discussion.on_text? = content_for :head do = stylesheet_link_tag 'mailers/highlighted_diff_email' diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index f6e5c9d33ac..f2d99872401 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -890,22 +890,14 @@ describe Notify do shared_examples 'an email for a note on a diff discussion' do |model| let(:note) { create(model, author: note_author) } - context 'when note is on image' do + context 'when note is not on text' do before do - allow_any_instance_of(DiffDiscussion).to receive(:on_image?).and_return(true) + allow_any_instance_of(DiffDiscussion).to receive(:on_text?).and_return(false) end it 'does not include diffs with character-level highlighting' do is_expected.not_to have_body_text '}' end - - it 'ends the intro with a dot' do - is_expected.to have_body_text "#{note.diff_file.file_path}." - end - end - - it 'ends the intro with a colon' do - is_expected.to have_body_text "#{note.diff_file.file_path}:" end it 'includes diffs with character-level highlighting' do