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
e4569d25
Commit
e4569d25
authored
Jul 02, 2018
by
Jarka Kadlecová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create todos only for newly mentioned users on epics
parent
d90635ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
ee/app/services/epics/update_service.rb
ee/app/services/epics/update_service.rb
+7
-4
ee/spec/services/epics/update_service_spec.rb
ee/spec/services/epics/update_service_spec.rb
+19
-0
No files found.
ee/app/services/epics/update_service.rb
View file @
e4569d25
...
...
@@ -3,11 +3,14 @@ module Epics
def
execute
(
epic
)
update
(
epic
)
# TODO: old_mentioned_users
# TODO: move to handle_changes method
todo_service
.
update_epic
(
epic
,
current_user
,
[])
epic
end
def
handle_changes
(
epic
,
options
)
old_associations
=
options
.
fetch
(
:old_associations
,
{})
old_mentioned_users
=
old_associations
.
fetch
(
:mentioned_users
,
[])
todo_service
.
update_epic
(
epic
,
current_user
,
old_mentioned_users
)
end
end
end
ee/spec/services/epics/update_service_spec.rb
View file @
e4569d25
...
...
@@ -6,6 +6,9 @@ describe Epics::UpdateService do
let
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
describe
'#execute'
do
before
do
stub_licensed_features
(
epics:
true
)
end
def
update_epic
(
opts
)
described_class
.
new
(
group
,
user
,
opts
).
execute
(
epic
)
end
...
...
@@ -56,5 +59,21 @@ describe Epics::UpdateService do
expect
(
note
.
noteable
).
to
eq
(
epic
)
end
end
context
'todos'
do
let
(
:mentioned1
)
{
create
(
:user
)
}
let
(
:mentioned2
)
{
create
(
:user
)
}
before
do
group
.
update
(
visibility:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
epic
.
update
(
description:
"FYI:
#{
mentioned1
.
to_reference
}
"
)
end
it
'creates todos for only newly mentioned users'
do
expect
{
update_epic
(
description:
"FYI:
#{
mentioned1
.
to_reference
}
#{
mentioned2
.
to_reference
}
"
)
}.
to
change
{
Todo
.
count
}.
by
(
1
)
end
end
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