diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-04-25 22:01:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-25 22:01:08 +0200 |
commit | 2744f61696df70e722cd6ade9564ad4f0f8f34d6 (patch) | |
tree | 0ac14794c172b692330ac2c7dadbb29037211724 /spec | |
parent | be637146f310d7ec3a49d01e850959514e9e4964 (diff) |
Fix not being able to resolve public resources in development environment (#13505)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/fetch_resource_service_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/services/fetch_resource_service_spec.rb b/spec/services/fetch_resource_service_spec.rb index 3af6a0689..ded05ffbc 100644 --- a/spec/services/fetch_resource_service_spec.rb +++ b/spec/services/fetch_resource_service_spec.rb @@ -21,7 +21,11 @@ RSpec.describe FetchResourceService, type: :service do context 'when OpenSSL::SSL::SSLError is raised' do before do - allow(Request).to receive_message_chain(:new, :add_headers, :on_behalf_of, :perform).and_raise(OpenSSL::SSL::SSLError) + request = double() + allow(Request).to receive(:new).and_return(request) + allow(request).to receive(:add_headers) + allow(request).to receive(:on_behalf_of) + allow(request).to receive(:perform).and_raise(OpenSSL::SSL::SSLError) end it { is_expected.to be_nil } @@ -29,7 +33,11 @@ RSpec.describe FetchResourceService, type: :service do context 'when HTTP::ConnectionError is raised' do before do - allow(Request).to receive_message_chain(:new, :add_headers, :on_behalf_of, :perform).and_raise(HTTP::ConnectionError) + request = double() + allow(Request).to receive(:new).and_return(request) + allow(request).to receive(:add_headers) + allow(request).to receive(:on_behalf_of) + allow(request).to receive(:perform).and_raise(HTTP::ConnectionError) end it { is_expected.to be_nil } |