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
ad2c9e65
Commit
ad2c9e65
authored
Jan 07, 2020
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply fix from @ahegyi
Checks if the project id param is available
parent
8ac27d4f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
ee/app/controllers/analytics/cycle_analytics/summary_controller.rb
...ntrollers/analytics/cycle_analytics/summary_controller.rb
+3
-5
ee/spec/controllers/analytics/cycle_analytics/summary_controller_spec.rb
...lers/analytics/cycle_analytics/summary_controller_spec.rb
+18
-0
ee/spec/frontend/fixtures/analytics.rb
ee/spec/frontend/fixtures/analytics.rb
+2
-0
No files found.
ee/app/controllers/analytics/cycle_analytics/summary_controller.rb
View file @
ad2c9e65
...
...
@@ -21,11 +21,9 @@ module Analytics
private
def
group_params
{
created_after:
request_params
.
created_after
,
created_before:
request_params
.
created_before
,
project_ids:
request_params
.
project_ids
}
hash
=
{
created_after:
request_params
.
created_after
,
created_before:
request_params
.
created_before
}
hash
[
:project_ids
]
=
request_params
.
project_ids
if
request_params
.
project_ids
.
any?
hash
end
def
validate_params
...
...
ee/spec/controllers/analytics/cycle_analytics/summary_controller_spec.rb
View file @
ad2c9e65
...
...
@@ -25,6 +25,24 @@ describe Analytics::CycleAnalytics::SummaryController do
expect
(
response
).
to
match_response_schema
(
'analytics/cycle_analytics/summary'
,
dir:
'ee'
)
end
it
'omits `projects` parameter if it is not given'
do
expect
(
CycleAnalytics
::
GroupLevel
).
to
receive
(
:new
).
with
(
group:
group
,
options:
hash_excluding
(
:projects
)).
and_call_original
subject
expect
(
response
).
to
be_successful
end
it
'contains `projects` parameter'
do
params
[
:project_ids
]
=
[
-
1
]
expect
(
CycleAnalytics
::
GroupLevel
).
to
receive
(
:new
).
with
(
group:
group
,
options:
hash_including
(
:projects
)).
and_call_original
subject
expect
(
response
).
to
be_successful
end
include_examples
'cycle analytics data endpoint examples'
include_examples
'group permission check on the controller level'
end
...
...
ee/spec/frontend/fixtures/analytics.rb
View file @
ad2c9e65
...
...
@@ -180,6 +180,8 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
stub_feature_flags
(
Gitlab
::
Analytics
::
CYCLE_ANALYTICS_FEATURE_FLAG
=>
true
)
stub_licensed_features
(
cycle_analytics_for_groups:
true
)
prepare_cycle_analytics_data
sign_in
(
user
)
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