Commit b4a3e045 authored by Dmitry Gruzd's avatar Dmitry Gruzd

Add basic_search parameter to search API

parent c48b8498
......@@ -35,6 +35,7 @@ module API
state: params[:state],
confidential: params[:confidential],
snippets: snippets?,
basic_search: params[:basic_search],
page: params[:page],
per_page: params[:per_page]
}.merge(additional_params)
......
......@@ -516,6 +516,14 @@ RSpec.describe API::Search do
end
end
context 'when requesting basic search' do
it 'passes the parameter to search service' do
expect(SearchService).to receive(:new).with(user, hash_including(basic_search: 'true'))
get api(endpoint, user), params: { scope: 'issues', search: 'awesome', basic_search: 'true' }
end
end
context 'for merge_requests scope' do
let(:endpoint) { "/projects/#{repo_project.id}/search" }
......
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