|
|
|
@ -68,7 +68,7 @@ describe SearchService, type: :service do
|
|
|
|
|
allow(AccountSearchService).to receive(:new).and_return(service)
|
|
|
|
|
|
|
|
|
|
results = subject.call(query, nil, 10)
|
|
|
|
|
expect(service).to have_received(:call).with(query, nil, limit: 10, offset: 0, resolve: false, use_searchable_text: true, following: false)
|
|
|
|
|
expect(service).to have_received(:call).with(query, nil, limit: 10, offset: 0, resolve: false, start_with_hashtag: false, use_searchable_text: true, following: false)
|
|
|
|
|
expect(results).to eq empty_results.merge(accounts: [account])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -92,15 +92,6 @@ describe SearchService, type: :service do
|
|
|
|
|
expect(Tag).to_not have_received(:search_for)
|
|
|
|
|
expect(results).to eq empty_results
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'does not include account when starts with # character' do
|
|
|
|
|
query = '#tag'
|
|
|
|
|
allow(AccountSearchService).to receive(:new)
|
|
|
|
|
|
|
|
|
|
results = subject.call(query, nil, 10)
|
|
|
|
|
expect(AccountSearchService).to_not have_received(:new)
|
|
|
|
|
expect(results).to eq empty_results
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|