Commit a660f548 authored by Mark Chao's avatar Mark Chao

Plural reason(s)

parent 953bb41f
...@@ -59,7 +59,7 @@ module Emails ...@@ -59,7 +59,7 @@ module Emails
def merge_request_unmergeable_email(recipient_id, merge_request_id, reason = nil) def merge_request_unmergeable_email(recipient_id, merge_request_id, reason = nil)
setup_merge_request_mail(merge_request_id, recipient_id) setup_merge_request_mail(merge_request_id, recipient_id)
@merge_request_presenter = MergeRequestPresenter.new(@merge_request, current_user: current_user) @reasons = MergeRequestPresenter.new(@merge_request, current_user: current_user).unmergeable_reasons
mail_answer_thread(@merge_request, merge_request_thread_options(@merge_request.author_id, recipient_id, reason)) mail_answer_thread(@merge_request, merge_request_thread_options(@merge_request.author_id, recipient_id, reason))
end end
......
%p %p
Merge Request #{link_to @merge_request.to_reference, project_merge_request_url(@merge_request.target_project, @merge_request)} can no longer be merged due to the following reason(s): Merge Request #{link_to @merge_request.to_reference, project_merge_request_url(@merge_request.target_project, @merge_request)} can no longer be merged due to the following #{pluralize(@reasons, 'reason')}:
%ul %ul
- @merge_request_presenter.unmergeable_reasons.each do |reason| - @reasons.each do |reason|
%li= reason %li= reason
Merge Request #{@merge_request.to_reference} can no longer be merged due to the following reason(s): Merge Request #{@merge_request.to_reference} can no longer be merged due to the following #{pluralize(@reasons, 'reason')}:
- @merge_request_presenter.unmergeable_reasons.each do |reason| - @reasons.each do |reason|
* #{reason} * #{reason}
Merge Request url: #{project_merge_request_url(@merge_request.target_project, @merge_request)} Merge Request url: #{project_merge_request_url(@merge_request.target_project, @merge_request)}
......
...@@ -422,6 +422,7 @@ describe Notify do ...@@ -422,6 +422,7 @@ describe Notify do
aggregate_failures do aggregate_failures do
is_expected.to have_referable_subject(merge_request, reply: true) is_expected.to have_referable_subject(merge_request, reply: true)
is_expected.to have_body_text(project_merge_request_path(project, merge_request)) is_expected.to have_body_text(project_merge_request_path(project, merge_request))
is_expected.to have_body_text('reasons:')
reasons.each do |reason| reasons.each do |reason|
is_expected.to have_body_text(reason) is_expected.to have_body_text(reason)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment