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
714d7ad0
Commit
714d7ad0
authored
Feb 08, 2021
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track task list item status changes
parent
531baf3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
app/services/issuable_base_service.rb
app/services/issuable_base_service.rb
+5
-0
spec/support/shared_examples/services/issuable_shared_examples.rb
...port/shared_examples/services/issuable_shared_examples.rb
+21
-0
No files found.
app/services/issuable_base_service.rb
View file @
714d7ad0
...
...
@@ -258,6 +258,11 @@ class IssuableBaseService < BaseService
invalidate_cache_counts
(
issuable
,
users:
issuable
.
assignees
.
to_a
)
after_update
(
issuable
)
execute_hooks
(
issuable
,
'update'
,
old_associations:
nil
)
if
issuable
.
is_a?
(
MergeRequest
)
Gitlab
::
UsageDataCounters
::
MergeRequestActivityUniqueCounter
.
track_task_item_status_changed
(
user:
current_user
)
end
end
end
...
...
spec/support/shared_examples/services/issuable_shared_examples.rb
View file @
714d7ad0
...
...
@@ -18,6 +18,27 @@ RSpec.shared_examples 'updating a single task' do
update_issuable
(
description:
"- [ ] Task 1
\n
- [ ] Task 2"
)
end
context
'usage counters'
do
it
'update as expected'
do
if
try
(
:merge_request
)
expect
(
Gitlab
::
UsageDataCounters
::
MergeRequestActivityUniqueCounter
)
.
to
receive
(
:track_task_item_status_changed
).
once
.
with
(
user:
user
)
else
expect
(
Gitlab
::
UsageDataCounters
::
MergeRequestActivityUniqueCounter
)
.
not_to
receive
(
:track_task_item_status_changed
)
end
update_issuable
(
update_task:
{
index:
1
,
checked:
true
,
line_source:
'- [ ] Task 1'
,
line_number:
1
}
)
end
end
context
'when a task is marked as completed'
do
before
do
update_issuable
(
update_task:
{
index:
1
,
checked:
true
,
line_source:
'- [ ] Task 1'
,
line_number:
1
})
...
...
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