Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1374e3ee
Commit
1374e3ee
authored
Mar 05, 2021
by
David Kim
Committed by
Dylan Griffith
Mar 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reviewers detail to closed merge request email
parent
d8a891a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
2 deletions
+41
-2
app/views/notify/closed_merge_request_email.text.haml
app/views/notify/closed_merge_request_email.text.haml
+1
-0
changelogs/unreleased/300750-add-missing-reviewers-information-to-closed-merge-request-email.yml
...g-reviewers-information-to-closed-merge-request-email.yml
+5
-0
spec/mailers/emails/merge_requests_spec.rb
spec/mailers/emails/merge_requests_spec.rb
+35
-2
No files found.
app/views/notify/closed_merge_request_email.text.haml
View file @
1374e3ee
...
...
@@ -6,3 +6,4 @@ Merge Request URL: #{project_merge_request_url(@merge_request.target_project, @m
Author:
#{
sanitize_name
(
@merge_request
.
author_name
)
}
=
assignees_label
(
@merge_request
)
=
reviewers_label
(
@merge_request
)
changelogs/unreleased/300750-add-missing-reviewers-information-to-closed-merge-request-email.yml
0 → 100644
View file @
1374e3ee
---
title
:
Add reviewers detail to text version of closed merge request email
merge_request
:
55594
author
:
type
:
added
spec/mailers/emails/merge_requests_spec.rb
View file @
1374e3ee
...
...
@@ -8,7 +8,7 @@ RSpec.describe Emails::MergeRequests do
include_context
'gitlab email notification'
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:current_user
,
reload:
true
)
{
create
(
:user
,
email:
"current@email.com"
,
name:
'www.example.com'
)
}
let_it_be
(
:assignee
,
reload:
true
)
{
create
(
:user
,
email:
'assignee@example.com'
,
name:
'John Doe'
)
}
let_it_be
(
:reviewer
,
reload:
true
)
{
create
(
:user
,
email:
'reviewer@example.com'
,
name:
'Jane Doe'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
...
...
@@ -22,6 +22,39 @@ RSpec.describe Emails::MergeRequests do
end
let
(
:recipient
)
{
assignee
}
let
(
:current_user_sanitized
)
{
'www_example_com'
}
describe
'#closed_merge_request_email'
do
subject
{
Notify
.
closed_merge_request_email
(
recipient
.
id
,
merge_request
.
id
,
current_user
.
id
)
}
it_behaves_like
'an answer to an existing thread with reply-by-email enabled'
do
let
(
:model
)
{
merge_request
}
end
it_behaves_like
'it should show Gmail Actions View Merge request link'
it_behaves_like
'an unsubscribeable thread'
it_behaves_like
'appearance header and footer enabled'
it_behaves_like
'appearance header and footer not enabled'
it
'is sent as the author'
do
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
expect
(
sender
.
display_name
).
to
eq
(
current_user
.
name
)
expect
(
sender
.
address
).
to
eq
(
gitlab_sender
)
end
it
'has the correct subject and body'
do
aggregate_failures
do
is_expected
.
to
have_referable_subject
(
merge_request
,
reply:
true
)
is_expected
.
to
have_body_text
(
'closed'
)
is_expected
.
to
have_body_text
(
current_user_sanitized
)
is_expected
.
to
have_body_text
(
project_merge_request_path
(
project
,
merge_request
))
is_expected
.
to
have_link
(
merge_request
.
to_reference
,
href:
project_merge_request_url
(
merge_request
.
target_project
,
merge_request
))
expect
(
subject
.
text_part
).
to
have_content
(
assignee
.
name
)
expect
(
subject
.
text_part
).
to
have_content
(
reviewer
.
name
)
end
end
end
describe
'#merged_merge_request_email'
do
let
(
:merge_author
)
{
assignee
}
...
...
@@ -79,7 +112,7 @@ RSpec.describe Emails::MergeRequests do
subject
{
Notify
.
resolved_all_discussions_email
(
recipient
.
id
,
merge_request
.
id
,
current_user
.
id
)
}
it
"includes the name of the resolver"
do
expect
(
subject
).
to
have_body_text
current_user
.
name
expect
(
subject
).
to
have_body_text
current_user
_sanitized
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment