Add exclude_unreviewed
param to GET /api/v2/search
REST API (#11977)
Make it so normal search returns even unreviewed matches, but autosuggestions do not. Fix #11960
This commit is contained in:
parent
234c729c52
commit
ab33c4df94
6 changed files with 22 additions and 17 deletions
|
@ -77,10 +77,10 @@ describe SearchService, type: :service do
|
|||
it 'includes the tag in the results' do
|
||||
query = '#tag'
|
||||
tag = Tag.new
|
||||
allow(Tag).to receive(:search_for).with('tag', 10, 0).and_return([tag])
|
||||
allow(Tag).to receive(:search_for).with('tag', 10, 0, exclude_unreviewed: nil).and_return([tag])
|
||||
|
||||
results = subject.call(query, nil, 10)
|
||||
expect(Tag).to have_received(:search_for).with('tag', 10, 0)
|
||||
expect(Tag).to have_received(:search_for).with('tag', 10, 0, exclude_unreviewed: nil)
|
||||
expect(results).to eq empty_results.merge(hashtags: [tag])
|
||||
end
|
||||
it 'does not include tag when starts with @ character' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue