Commit 9533696e authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'cablett-change-draft-status-email' into 'master'

Add link to MR when draft status changed

See merge request gitlab-org/gitlab!61891
parents 8af5e551 d74a18e7
%p %p= html_escape(_('%{username} changed the draft status of merge request %{mr_link}')) % { username: link_to(@updated_by_user.name, user_url(@updated_by_user)),
= _('%{username} changed the draft status of merge request %{mr_reference}' % {username: sanitize_name(@updated_by_user.name), mr_reference: @merge_request.to_reference }) mr_link: merge_request_reference_link(@merge_request) }
---
title: Add link to email notifying of MR changing draft status
merge_request: 61891
author:
type: changed
...@@ -978,6 +978,9 @@ msgstr "" ...@@ -978,6 +978,9 @@ msgstr ""
msgid "%{user_name} profile page" msgid "%{user_name} profile page"
msgstr "" msgstr ""
msgid "%{username} changed the draft status of merge request %{mr_link}"
msgstr ""
msgid "%{username} has asked for a GitLab account on your instance %{host}:" msgid "%{username} has asked for a GitLab account on your instance %{host}:"
msgstr "" msgstr ""
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe 'notify/change_in_merge_request_draft_status_email.html.haml' do RSpec.describe 'notify/change_in_merge_request_draft_status_email.html.haml' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
let(:merge_request_link) { merge_request_url(merge_request) }
before do before do
assign(:updated_by_user, user) assign(:updated_by_user, user)
...@@ -15,5 +16,7 @@ RSpec.describe 'notify/change_in_merge_request_draft_status_email.html.haml' do ...@@ -15,5 +16,7 @@ RSpec.describe 'notify/change_in_merge_request_draft_status_email.html.haml' do
render render
expect(rendered).to have_content("#{user.name} changed the draft status of merge request #{merge_request.to_reference}") expect(rendered).to have_content("#{user.name} changed the draft status of merge request #{merge_request.to_reference}")
expect(rendered).to have_link(user.name, href: user_url(user))
expect(rendered).to have_link(merge_request.to_reference, href: merge_request_link)
end end
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