commit: e34c5a350321c6c1997bdcc15fbd85cfb521f51b
parent: 004672aa6c482b212e36b9e794d107be456a11da
Author: unarist <m.unarist@gmail.com>
Date: Tue, 6 Jun 2017 23:44:48 +0900
Fix 500 errors on searching invalid URLs (#3613)
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/services/fetch_remote_resource_service.rb b/app/services/fetch_remote_resource_service.rb
@@ -5,7 +5,7 @@ class FetchRemoteResourceService < BaseService
def call(url)
@url = url
- process_url unless atom_url.nil?
+ process_url unless fetched_atom_feed.nil?
end
private
diff --git a/spec/services/fetch_remote_resource_service_spec.rb b/spec/services/fetch_remote_resource_service_spec.rb
@@ -10,7 +10,7 @@ describe FetchRemoteResourceService do
url = 'http://example.com/missing-atom'
service = double
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)
expect(result).to be_nil