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
c31ba545
Commit
c31ba545
authored
Mar 11, 2022
by
John Hope
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '228646-filter-epics-pill-count-by-visibility' into 'master'"
This reverts merge request !76456
parent
5a140d5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
25 deletions
+9
-25
ee/app/services/groups/epics_count_service.rb
ee/app/services/groups/epics_count_service.rb
+1
-1
ee/spec/services/groups/epics_count_service_spec.rb
ee/spec/services/groups/epics_count_service_spec.rb
+8
-24
No files found.
ee/app/services/groups/epics_count_service.rb
View file @
c31ba545
...
...
@@ -11,7 +11,7 @@ module Groups
def
relation_for_count
EpicsFinder
.
new
(
user
,
group_id:
group
.
id
,
state:
'opened'
)
.
execute
(
skip_visibility_check:
fals
e
)
.
execute
(
skip_visibility_check:
tru
e
)
end
def
issuable_key
...
...
ee/spec/services/groups/epics_count_service_spec.rb
View file @
c31ba545
...
...
@@ -10,33 +10,17 @@ RSpec.describe Groups::EpicsCountService, :use_clean_rails_memory_store_caching
subject
{
described_class
.
new
(
group
,
user
)
}
describe
'#relation_for_count'
do
context
"when the user is a reporter"
do
before
do
group
.
add_reporter
(
user
)
allow
(
EpicsFinder
).
to
receive
(
:new
).
and_call_original
end
it
'uses the EpicsFinder to scope epics'
do
expect
(
EpicsFinder
)
.
to
receive
(
:new
)
.
with
(
user
,
group_id:
group
.
id
,
state:
'opened'
)
subject
.
count
end
before
do
group
.
add_reporter
(
user
)
allow
(
EpicsFinder
).
to
receive
(
:new
).
and_call_original
end
context
"when there are confidential epics"
do
let_it_be
(
:epic
)
{
create
(
:epic
,
:confidential
,
group:
group
)
}
context
"when the user has view access to the group and its epics"
do
it
"filters the count by visibility"
do
allow
(
Ability
).
to
receive
(
:allowed?
).
and_call_original
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_epic
,
group
).
and_return
(
true
)
it
'uses the EpicsFinder to scope epics'
do
expect
(
EpicsFinder
)
.
to
receive
(
:new
)
.
with
(
user
,
group_id:
group
.
id
,
state:
'opened'
)
expect
(
group
.
epics
.
count
).
to
eq
(
2
)
expect
(
subject
.
count
).
to
eq
(
1
)
end
end
subject
.
count
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