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
8a4cf342
Commit
8a4cf342
authored
Oct 24, 2019
by
Eugenia Grieff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs todos created by issuables mentions
parent
42e6e1a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
changelogs/unreleased/33902-fix-private-group-todo-mentions.yml
...logs/unreleased/33902-fix-private-group-todo-mentions.yml
+5
-0
ee/spec/services/epics/update_service_spec.rb
ee/spec/services/epics/update_service_spec.rb
+34
-0
spec/support/shared_examples/updating_mentions_shared_examples.rb
...port/shared_examples/updating_mentions_shared_examples.rb
+18
-0
No files found.
changelogs/unreleased/33902-fix-private-group-todo-mentions.yml
0 → 100644
View file @
8a4cf342
---
title
:
Do not generate To-Dos additional when editing group mentions
merge_request
:
19037
author
:
type
:
fixed
ee/spec/services/epics/update_service_spec.rb
View file @
8a4cf342
...
@@ -136,6 +136,40 @@ describe Epics::UpdateService do
...
@@ -136,6 +136,40 @@ describe Epics::UpdateService do
expect
(
todo2
.
reload
.
state
).
to
eq
(
'pending'
)
expect
(
todo2
.
reload
.
state
).
to
eq
(
'pending'
)
end
end
end
end
context
'mentioning a group in epic description'
do
let
(
:mentioned1
)
{
create
(
:user
)
}
let
(
:mentioned2
)
{
create
(
:user
)
}
before
do
group
.
add_developer
(
mentioned1
)
epic
.
update
(
description:
"FYI:
#{
group
.
to_reference
}
"
)
end
context
'when the group is public'
do
before
do
group
.
update
(
visibility:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
end
it
'creates todos for only newly mentioned users'
do
expect
do
update_epic
(
description:
"FYI:
#{
mentioned1
.
to_reference
}
#{
mentioned2
.
to_reference
}
"
)
end
.
to
change
{
Todo
.
count
}.
by
(
1
)
end
end
context
'when the group is private'
do
before
do
group
.
update
(
visibility:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
it
'creates todos for only newly mentioned users that are group members'
do
expect
do
update_epic
(
description:
"FYI:
#{
mentioned1
.
to_reference
}
#{
mentioned2
.
to_reference
}
"
)
end
.
to
not_change
{
Todo
.
count
}
end
end
end
end
end
context
'when Epic has tasks'
do
context
'when Epic has tasks'
do
...
...
spec/support/shared_examples/updating_mentions_shared_examples.rb
View file @
8a4cf342
...
@@ -58,9 +58,25 @@ RSpec.shared_examples 'updating mentions' do |service_class|
...
@@ -58,9 +58,25 @@ RSpec.shared_examples 'updating mentions' do |service_class|
end
end
end
end
shared_examples
'updating attribute with existing group mention'
do
|
attribute
|
before
do
mentionable
.
update!
({
attribute
=>
"FYI:
#{
group
.
to_reference
}
"
})
end
it
'creates todos for only newly mentioned users'
do
expect
do
update_mentionable
(
{
attribute
=>
"For
#{
group
.
to_reference
}
, cc:
#{
mentioned_user
.
to_reference
}
"
}
)
end
.
to
change
{
Todo
.
count
}.
by
(
1
)
end
end
context
'when group is public'
do
context
'when group is public'
do
it_behaves_like
'updating attribute with allowed mentions'
,
:title
it_behaves_like
'updating attribute with allowed mentions'
,
:title
it_behaves_like
'updating attribute with allowed mentions'
,
:description
it_behaves_like
'updating attribute with allowed mentions'
,
:description
it_behaves_like
'updating attribute with existing group mention'
,
:title
it_behaves_like
'updating attribute with existing group mention'
,
:description
end
end
context
'when the group is private'
do
context
'when the group is private'
do
...
@@ -70,6 +86,8 @@ RSpec.shared_examples 'updating mentions' do |service_class|
...
@@ -70,6 +86,8 @@ RSpec.shared_examples 'updating mentions' do |service_class|
it_behaves_like
'updating attribute with allowed mentions'
,
:title
it_behaves_like
'updating attribute with allowed mentions'
,
:title
it_behaves_like
'updating attribute with allowed mentions'
,
:description
it_behaves_like
'updating attribute with allowed mentions'
,
:description
it_behaves_like
'updating attribute with existing group mention'
,
:title
it_behaves_like
'updating attribute with existing group mention'
,
:description
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