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
6f256428
Commit
6f256428
authored
Sep 25, 2019
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure it also works for ActionController::Parameters
parent
462afa68
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
ee/lib/gitlab/insights/validators/params_validator.rb
ee/lib/gitlab/insights/validators/params_validator.rb
+1
-1
ee/spec/controllers/groups/insights_controller_spec.rb
ee/spec/controllers/groups/insights_controller_spec.rb
+2
-1
No files found.
ee/lib/gitlab/insights/validators/params_validator.rb
View file @
6f256428
...
...
@@ -20,7 +20,7 @@ module Gitlab
end
if
params
[
:projects
]
unless
params
[
:projects
].
is_a?
(
Hash
)
unless
params
[
:projects
].
is_a?
(
Hash
)
||
params
[
:projects
].
is_a?
(
ActionController
::
Parameters
)
raise
InvalidProjectsError
,
"Invalid `:projects`: `
#{
params
[
:projects
]
}
`. It should be a hash."
end
...
...
ee/spec/controllers/groups/insights_controller_spec.rb
View file @
6f256428
...
...
@@ -8,7 +8,8 @@ describe Groups::InsightsController do
set
(
:project
)
{
create
(
:project
,
:private
)
}
set
(
:insight
)
{
create
(
:insight
,
group:
parent_group
,
project:
project
)
}
set
(
:user
)
{
create
(
:user
)
}
let
(
:query_params
)
{
{
type:
'bar'
,
query:
{
issuable_type:
'issue'
,
collection_labels:
[
'bug'
]
}
}
}
let
(
:query_params
)
{
{
type:
'bar'
,
query:
{
issuable_type:
'issue'
,
collection_labels:
[
'bug'
]
},
projects:
projects_params
}
}
let
(
:projects_params
)
{
{
only:
[
project
.
id
,
project
.
full_path
]
}
}
before
do
stub_licensed_features
(
insights:
true
)
...
...
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