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
2c060a54
Commit
2c060a54
authored
Mar 06, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jprovaznik: Add `row_count` to helper
parent
ef10484f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
ee/app/finders/epics_finder.rb
ee/app/finders/epics_finder.rb
+7
-1
ee/spec/finders/epics_finder_spec.rb
ee/spec/finders/epics_finder_spec.rb
+18
-0
No files found.
ee/app/finders/epics_finder.rb
View file @
2c060a54
...
@@ -17,7 +17,13 @@ class EpicsFinder < IssuableFinder
...
@@ -17,7 +17,13 @@ class EpicsFinder < IssuableFinder
end
end
def
row_count
def
row_count
execute
.
count
count
=
execute
.
count
# When filtering by multiple labels, count returns a hash of
# records grouped by id - so we just have to get length of the Hash.
# Once we have state for epics, we can use default issuables row_count
# method.
count
.
is_a?
(
Hash
)
?
count
.
length
:
count
end
end
# we don't have states for epics for now this method (#4017)
# we don't have states for epics for now this method (#4017)
...
...
ee/spec/finders/epics_finder_spec.rb
View file @
2c060a54
...
@@ -130,4 +130,22 @@ describe EpicsFinder do
...
@@ -130,4 +130,22 @@ describe EpicsFinder do
end
end
end
end
end
end
describe
'#row_count'
do
let
(
:label
)
{
create
(
:label
)
}
let
(
:label2
)
{
create
(
:label
)
}
let!
(
:labeled_epic
)
{
create
(
:labeled_epic
,
group:
group
,
labels:
[
label
])
}
let!
(
:labeled_epic2
)
{
create
(
:labeled_epic
,
group:
group
,
labels:
[
label
,
label2
])
}
before
do
group
.
add_developer
(
search_user
)
stub_licensed_features
(
epics:
true
)
end
it
'returns number of rows when epics are grouped'
do
params
=
{
group_id:
group
.
id
,
label_name:
[
label
.
title
,
label2
.
title
]
}
expect
(
described_class
.
new
(
search_user
,
params
).
row_count
).
to
eq
(
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