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
5dd28621
Commit
5dd28621
authored
Nov 09, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix image diff notes email
parent
1bf68956
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
app/views/notify/_note_email.html.haml
app/views/notify/_note_email.html.haml
+8
-3
changelogs/unreleased/issue_39238.yml
changelogs/unreleased/issue_39238.yml
+5
-0
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+19
-1
No files found.
app/views/notify/_note_email.html.haml
View file @
5dd28621
-
discussion
=
@note
.
discussion
if
@note
.
part_of_discussion?
-
discussion
=
@note
.
discussion
if
@note
.
part_of_discussion?
-
diff_discussion
=
discussion
&
.
diff_discussion?
-
on_image
=
discussion
.
on_image?
if
diff_discussion
-
if
discussion
-
if
discussion
-
phrase_end_char
=
on_image
?
"."
:
":"
%p
.details
%p
.details
=
succeed
':'
do
=
succeed
phrase_end_char
do
=
link_to
@note
.
author_name
,
user_url
(
@note
.
author
)
=
link_to
@note
.
author_name
,
user_url
(
@note
.
author
)
-
if
di
scussion
.
diff_discussion?
-
if
di
ff_discussion
-
if
discussion
.
new_discussion?
-
if
discussion
.
new_discussion?
started a new discussion
started a new discussion
-
else
-
else
...
@@ -21,7 +26,7 @@
...
@@ -21,7 +26,7 @@
%p
.details
%p
.details
#{
link_to
@note
.
author_name
,
user_url
(
@note
.
author
)
}
commented:
#{
link_to
@note
.
author_name
,
user_url
(
@note
.
author
)
}
commented:
-
if
di
scussion
&
.
diff_discussion?
-
if
di
ff_discussion
&&
!
on_image
=
content_for
:head
do
=
content_for
:head
do
=
stylesheet_link_tag
'mailers/highlighted_diff_email'
=
stylesheet_link_tag
'mailers/highlighted_diff_email'
...
...
changelogs/unreleased/issue_39238.yml
0 → 100644
View file @
5dd28621
---
title
:
Fix image diff notification email from showing wrong content
merge_request
:
author
:
type
:
fixed
spec/mailers/notify_spec.rb
View file @
5dd28621
...
@@ -783,7 +783,25 @@ describe Notify do
...
@@ -783,7 +783,25 @@ describe Notify do
shared_examples
'an email for a note on a diff discussion'
do
|
model
|
shared_examples
'an email for a note on a diff discussion'
do
|
model
|
let
(
:note
)
{
create
(
model
,
author:
note_author
)
}
let
(
:note
)
{
create
(
model
,
author:
note_author
)
}
it
"includes diffs with character-level highlighting"
do
context
'when note is on image'
do
before
do
allow_any_instance_of
(
DiffDiscussion
).
to
receive
(
:on_image?
).
and_return
(
true
)
end
it
'does not include diffs with character-level highlighting'
do
is_expected
.
not_to
have_body_text
'<span class="p">}</span></span>'
end
it
'ends the intro with a dot'
do
is_expected
.
to
have_body_text
"
#{
note
.
diff_file
.
file_path
}
</a>."
end
end
it
'ends the intro with a colon'
do
is_expected
.
to
have_body_text
"
#{
note
.
diff_file
.
file_path
}
</a>:"
end
it
'includes diffs with character-level highlighting'
do
is_expected
.
to
have_body_text
'<span class="p">}</span></span>'
is_expected
.
to
have_body_text
'<span class="p">}</span></span>'
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