diff options
author | ThibG <thib@sitedethib.com> | 2019-02-26 21:40:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-26 21:40:28 +0100 |
commit | ff2270cd061b2dc3fc86a5b2bd77d0a3408b5716 (patch) | |
tree | 75adb7dc4d3c37ecf87b43659538e20ec198d804 /spec/services/search_service_spec.rb | |
parent | d82de360c13894746d3974d11c9505c8937ebdee (diff) | |
parent | 1e06ca1c0af98cf61b1114b93249fb447e795edb (diff) |
Merge pull request #930 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/services/search_service_spec.rb')
-rw-r--r-- | spec/services/search_service_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/services/search_service_spec.rb b/spec/services/search_service_spec.rb index 671080f1d..d064cd9b8 100644 --- a/spec/services/search_service_spec.rb +++ b/spec/services/search_service_spec.rb @@ -10,7 +10,7 @@ describe SearchService, type: :service do it 'returns empty results without searching' do allow(AccountSearchService).to receive(:new) allow(Tag).to receive(:search_for) - results = subject.call('', 10) + results = subject.call('', nil, 10) expect(results).to eq(empty_results) expect(AccountSearchService).not_to have_received(:new) @@ -27,7 +27,7 @@ describe SearchService, type: :service do it 'returns the empty results' do service = double(call: nil) allow(ResolveURLService).to receive(:new).and_return(service) - results = subject.call(@query, 10) + results = subject.call(@query, nil, 10) expect(service).to have_received(:call).with(@query, on_behalf_of: nil) expect(results).to eq empty_results @@ -40,7 +40,7 @@ describe SearchService, type: :service do service = double(call: account) allow(ResolveURLService).to receive(:new).and_return(service) - results = subject.call(@query, 10) + results = subject.call(@query, nil, 10) expect(service).to have_received(:call).with(@query, on_behalf_of: nil) expect(results).to eq empty_results.merge(accounts: [account]) end @@ -52,7 +52,7 @@ describe SearchService, type: :service do service = double(call: status) allow(ResolveURLService).to receive(:new).and_return(service) - results = subject.call(@query, 10) + results = subject.call(@query, nil, 10) expect(service).to have_received(:call).with(@query, on_behalf_of: nil) expect(results).to eq empty_results.merge(statuses: [status]) end @@ -67,8 +67,8 @@ describe SearchService, type: :service do service = double(call: [account]) allow(AccountSearchService).to receive(:new).and_return(service) - results = subject.call(query, 10) - expect(service).to have_received(:call).with(query, 10, nil, resolve: false) + results = subject.call(query, nil, 10) + expect(service).to have_received(:call).with(query, nil, limit: 10, offset: 0, resolve: false) expect(results).to eq empty_results.merge(accounts: [account]) end end @@ -77,17 +77,17 @@ 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).and_return([tag]) + allow(Tag).to receive(:search_for).with('tag', 10, 0).and_return([tag]) - results = subject.call(query, 10) - expect(Tag).to have_received(:search_for).with('tag', 10) + results = subject.call(query, nil, 10) + expect(Tag).to have_received(:search_for).with('tag', 10, 0) expect(results).to eq empty_results.merge(hashtags: [tag]) end it 'does not include tag when starts with @ character' do query = '@username' allow(Tag).to receive(:search_for) - results = subject.call(query, 10) + results = subject.call(query, nil, 10) expect(Tag).not_to have_received(:search_for) expect(results).to eq empty_results end |