|
|
@ -26,7 +26,7 @@ describe SearchService do
|
|
|
|
context 'that does not find anything' do
|
|
|
|
context 'that does not find anything' do
|
|
|
|
it 'returns the empty results' do
|
|
|
|
it 'returns the empty results' do
|
|
|
|
service = double(call: nil)
|
|
|
|
service = double(call: nil)
|
|
|
|
allow(FetchRemoteResourceService).to receive(:new).and_return(service)
|
|
|
|
allow(ResolveURLService).to receive(:new).and_return(service)
|
|
|
|
results = subject.call(@query, 10)
|
|
|
|
results = subject.call(@query, 10)
|
|
|
|
|
|
|
|
|
|
|
|
expect(service).to have_received(:call).with(@query)
|
|
|
|
expect(service).to have_received(:call).with(@query)
|
|
|
@ -38,7 +38,7 @@ describe SearchService do
|
|
|
|
it 'includes the account in the results' do
|
|
|
|
it 'includes the account in the results' do
|
|
|
|
account = Account.new
|
|
|
|
account = Account.new
|
|
|
|
service = double(call: account)
|
|
|
|
service = double(call: account)
|
|
|
|
allow(FetchRemoteResourceService).to receive(:new).and_return(service)
|
|
|
|
allow(ResolveURLService).to receive(:new).and_return(service)
|
|
|
|
|
|
|
|
|
|
|
|
results = subject.call(@query, 10)
|
|
|
|
results = subject.call(@query, 10)
|
|
|
|
expect(service).to have_received(:call).with(@query)
|
|
|
|
expect(service).to have_received(:call).with(@query)
|
|
|
@ -50,7 +50,7 @@ describe SearchService do
|
|
|
|
it 'includes the status in the results' do
|
|
|
|
it 'includes the status in the results' do
|
|
|
|
status = Status.new
|
|
|
|
status = Status.new
|
|
|
|
service = double(call: status)
|
|
|
|
service = double(call: status)
|
|
|
|
allow(FetchRemoteResourceService).to receive(:new).and_return(service)
|
|
|
|
allow(ResolveURLService).to receive(:new).and_return(service)
|
|
|
|
|
|
|
|
|
|
|
|
results = subject.call(@query, 10)
|
|
|
|
results = subject.call(@query, 10)
|
|
|
|
expect(service).to have_received(:call).with(@query)
|
|
|
|
expect(service).to have_received(:call).with(@query)
|
|
|
|