diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-02-26 17:04:44 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-02-26 17:04:44 +0100 |
commit | 0158937fc2345a83f8ee5a64e85b14cabfe4b1e7 (patch) | |
tree | 79872e72c27d6371620c0dd8f04700aa0094020c /spec/services/search_service_spec.rb | |
parent | d82de360c13894746d3974d11c9505c8937ebdee (diff) | |
parent | a5e7ada62fa2824be158f0b3bed7f3c39ce9c0fa (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - Dockerfile Took upstream version and reverted f13ebd02c91776ddb88b5178bf9015c6e0f1ca80. Hopefuly it's not needed anymore. - app/controllers/api/v1/search_controller.rb The conflict was due to us raising the number of results returned. Upstream raised it further, so took it. - config/locales/de.yml Took upstream changes to theme translation strings. - config/locales/gl.yml Took upstream changes to theme translation strings. - config/locales/nl.yml Took upstream changes to theme translation strings. - config/locales/sk.yml Took upstream changes to theme translation strings.
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 |