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
388e2a12
Commit
388e2a12
authored
Nov 05, 2019
by
Jan Provaznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor review improvements
* renamed scope * added spec for disabled epics feature
parent
a2474646
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
5 deletions
+20
-5
ee/app/models/ee/epic.rb
ee/app/models/ee/epic.rb
+1
-1
ee/app/services/epics/descendant_count_service.rb
ee/app/services/epics/descendant_count_service.rb
+1
-1
ee/spec/models/epic_spec.rb
ee/spec/models/epic_spec.rb
+18
-3
No files found.
ee/app/models/ee/epic.rb
View file @
388e2a12
...
@@ -95,7 +95,7 @@ module EE
...
@@ -95,7 +95,7 @@ module EE
scope
:due_date_inherited
,
->
{
where
(
due_date_is_fixed:
[
nil
,
false
])
}
scope
:due_date_inherited
,
->
{
where
(
due_date_is_fixed:
[
nil
,
false
])
}
scope
:counts_by_state
,
->
{
group
(
:state_id
).
count
}
scope
:counts_by_state
,
->
{
group
(
:state_id
).
count
}
scope
:
id_not_in
,
->
(
ids
)
{
where
.
not
(
id:
ids
)
}
scope
:
excluding_ids
,
->
(
ids
)
{
where
.
not
(
id:
ids
)
}
MAX_HIERARCHY_DEPTH
=
5
MAX_HIERARCHY_DEPTH
=
5
...
...
ee/app/services/epics/descendant_count_service.rb
View file @
388e2a12
...
@@ -31,7 +31,7 @@ module Epics
...
@@ -31,7 +31,7 @@ module Epics
def
epics_count
def
epics_count
strong_memoize
(
:epics_count
)
do
strong_memoize
(
:epics_count
)
do
accessible_epics
.
id_not_in
([
epic
.
id
]).
counts_by_state
accessible_epics
.
excluding_ids
([
epic
.
id
]).
counts_by_state
end
end
end
end
...
...
ee/spec/models/epic_spec.rb
View file @
388e2a12
...
@@ -117,11 +117,26 @@ describe Epic do
...
@@ -117,11 +117,26 @@ describe Epic do
context
'with authorized user'
do
context
'with authorized user'
do
before
do
before
do
private_group
.
add_developer
(
user
)
private_group
.
add_developer
(
user
)
stub_licensed_features
(
epics:
true
)
end
end
it
'returns epic groups user can access'
do
context
'with epics enabled'
do
expect
(
subject
).
to
eq
[
private_group
]
before
do
stub_licensed_features
(
epics:
true
)
end
it
'returns epic groups user can access'
do
expect
(
subject
).
to
eq
[
private_group
]
end
end
context
'with epics are disabled'
do
before
do
stub_licensed_features
(
epics:
false
)
end
it
'returns an empty list'
do
expect
(
subject
).
to
be_empty
end
end
end
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