Browse Source

Fix 500 errors on searching invalid URLs (#3613)

master
unarist 7 years ago
committed by Eugen Rochko
parent
commit
e34c5a3503
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/services/fetch_remote_resource_service.rb
  2. +1
    -1
      spec/services/fetch_remote_resource_service_spec.rb

+ 1
- 1
app/services/fetch_remote_resource_service.rb View File

@ -5,7 +5,7 @@ class FetchRemoteResourceService < BaseService
def call(url) def call(url)
@url = url @url = url
process_url unless atom_url.nil?
process_url unless fetched_atom_feed.nil?
end end
private private

+ 1
- 1
spec/services/fetch_remote_resource_service_spec.rb View File

@ -10,7 +10,7 @@ describe FetchRemoteResourceService do
url = 'http://example.com/missing-atom' url = 'http://example.com/missing-atom'
service = double service = double
allow(FetchAtomService).to receive(:new).and_return service allow(FetchAtomService).to receive(:new).and_return service
allow(service).to receive(:call).with(url).and_return([nil, 'body'])
allow(service).to receive(:call).with(url).and_return(nil)
result = subject.call(url) result = subject.call(url)
expect(result).to be_nil expect(result).to be_nil

Loading…
Cancel
Save