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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
32a6f41f
Commit
32a6f41f
authored
Jul 08, 2014
by
Pierre de La Morinerie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include "Merge-request reopened" emails in the proper email thread
parent
414afd68
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+4
-3
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+29
-0
No files found.
app/mailers/emails/merge_requests.rb
View file @
32a6f41f
...
@@ -49,7 +49,8 @@ module Emails
...
@@ -49,7 +49,8 @@ module Emails
@updated_by
=
User
.
find
updated_by_user_id
@updated_by
=
User
.
find
updated_by_user_id
@target_url
=
project_merge_request_url
(
@project
,
@merge_request
)
@target_url
=
project_merge_request_url
(
@project
,
@merge_request
)
set_reference
(
"merge_request_
#{
merge_request_id
}
"
)
set_reference
(
"merge_request_
#{
merge_request_id
}
"
)
mail
(
from:
sender
(
updated_by_user_id
),
mail_answer_thread
(
@merge_request
,
from:
sender
(
updated_by_user_id
),
to:
recipient
(
recipient_id
),
to:
recipient
(
recipient_id
),
subject:
subject
(
"
#{
@merge_request
.
title
}
(#
#{
@merge_request
.
iid
}
)
#{
@mr_status
}
"
))
subject:
subject
(
"
#{
@merge_request
.
title
}
(#
#{
@merge_request
.
iid
}
)
#{
@mr_status
}
"
))
end
end
...
...
spec/mailers/notify_spec.rb
View file @
32a6f41f
...
@@ -322,6 +322,35 @@ describe Notify do
...
@@ -322,6 +322,35 @@ describe Notify do
end
end
end
end
describe
'status changed'
do
let
(
:status
)
{
'reopened'
}
subject
{
Notify
.
merge_request_status_email
(
recipient
.
id
,
merge_request
.
id
,
status
,
current_user
)
}
it_behaves_like
'an answer to an existing thread'
,
'merge_request'
it
'is sent as the author'
do
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
sender
.
display_name
.
should
eq
(
current_user
.
name
)
sender
.
address
.
should
eq
(
gitlab_sender
)
end
it
'has the correct subject'
do
should
have_subject
/
#{
merge_request
.
title
}
\(#
#{
merge_request
.
iid
}
\)/i
end
it
'contains the new status'
do
should
have_body_text
/
#{
status
}
/i
end
it
'contains the user name'
do
should
have_body_text
/
#{
current_user
.
name
}
/i
end
it
'contains a link to the merge request'
do
should
have_body_text
/
#{
project_merge_request_path
project
,
merge_request
}
/
end
end
describe
'that are merged'
do
describe
'that are merged'
do
subject
{
Notify
.
merged_merge_request_email
(
recipient
.
id
,
merge_request
.
id
,
merge_author
.
id
)
}
subject
{
Notify
.
merged_merge_request_email
(
recipient
.
id
,
merge_request
.
id
,
merge_author
.
id
)
}
...
...
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