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
Jérome Perrin
gitlab-ce
Commits
66c4ed61
Commit
66c4ed61
authored
Jul 13, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mentioned users list on diff notes
parent
8b7932c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
app/models/concerns/note_on_diff.rb
app/models/concerns/note_on_diff.rb
+3
-0
spec/services/todo_service_spec.rb
spec/services/todo_service_spec.rb
+18
-0
No files found.
app/models/concerns/note_on_diff.rb
View file @
66c4ed61
...
...
@@ -4,6 +4,9 @@ module NoteOnDiff
NUMBER_OF_TRUNCATED_DIFF_LINES
=
16
included
do
attr_mentionable
:note
,
pipeline: :note
participant
:author
delegate
:blob
,
:highlighted_diff_lines
,
to: :diff_file
,
allow_nil:
true
end
...
...
spec/services/todo_service_spec.rb
View file @
66c4ed61
...
...
@@ -435,6 +435,24 @@ describe TodoService, services: true do
should_create_todo
(
user:
author
,
target:
mr_unassigned
,
action:
Todo
::
MARKED
)
end
end
describe
'#new_note'
do
let
(
:mention
)
{
john_doe
.
to_reference
}
let
(
:diff_note_on_merge_request
)
{
create
(
:diff_note_on_merge_request
,
project:
project
,
noteable:
mr_unassigned
,
author:
author
,
note:
"Hey
#{
mention
}
"
)
}
let
(
:legacy_diff_note_on_merge_request
)
{
create
(
:legacy_diff_note_on_merge_request
,
project:
project
,
noteable:
mr_unassigned
,
author:
author
,
note:
"Hey
#{
mention
}
"
)
}
it
'creates a todo for mentioned user on new diff note'
do
service
.
new_note
(
diff_note_on_merge_request
,
author
)
should_create_todo
(
user:
john_doe
,
target:
mr_unassigned
,
author:
author
,
action:
Todo
::
MENTIONED
,
note:
diff_note_on_merge_request
)
end
it
'creates a todo for mentioned user on legacy diff note'
do
service
.
new_note
(
legacy_diff_note_on_merge_request
,
author
)
should_create_todo
(
user:
john_doe
,
target:
mr_unassigned
,
author:
author
,
action:
Todo
::
MENTIONED
,
note:
legacy_diff_note_on_merge_request
)
end
end
end
it
'updates cached counts when a todo is created'
do
...
...
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