Commit 6f256428 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Make sure it also works for ActionController::Parameters

parent 462afa68
......@@ -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
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment