diff options
author | Reverite <github@reverite.sh> | 2019-02-27 17:06:25 -0800 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-02-27 17:06:25 -0800 |
commit | 715c552fe4c1b2d59bf1f281d77b6e2546bdb531 (patch) | |
tree | 44e93d767f1b7cda48ff24020faa62675dd6140c /spec/services/search_service_spec.rb | |
parent | 54e480ca0939ba737f5abdf4ee861cd63c025865 (diff) | |
parent | 76ed481aa7b67d624675cdaa85bac583853fd24d (diff) |
Merge branch 'glitch'
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 |