diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml index 7199631abf376668b4553be390645cdd8dba9bc5..4f9964fff1434d40f2836e22044f199b7f667f97 100644 --- a/app/views/layouts/notify.html.haml +++ b/app/views/layouts/notify.html.haml @@ -1,5 +1,6 @@ - note = local_assigns.fetch(:note, @note) -- show_no_diff_preview_message = true +-# Diff preview text should only appear when a note is available. Default value to be false +- show_no_diff_preview_message = false - unless note.nil? - discussion = local_assigns.fetch(:discussion) { note.discussion } if note.part_of_discussion? - project = local_assigns.fetch(:project, @project) diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 566a3d108126853b5abab6a51a1acb4255916f5f..bbb5a77e89c58a9258f06b85bea3e51f1fc6b7dd 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -137,6 +137,7 @@ aggregate_failures do is_expected.to have_referable_subject(issue) is_expected.to have_body_text(project_issue_path(project, issue)) + is_expected.not_to have_body_text 'This project does not include diff previews in email notifications' end end