diff options
author | ThibG <thib@sitedethib.com> | 2020-05-03 23:29:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-03 23:29:41 +0200 |
commit | 75b0fa8b760b8829b933b249ac48965abdab15ae (patch) | |
tree | 4b2e5293f15972012c4dc876bb66870d692490d0 /spec/services/fetch_resource_service_spec.rb | |
parent | 9c61dadc0db7009853c6b2345a02c3b219022929 (diff) | |
parent | 89fcd68b7501f81a3e33f6b1abff6fc66f78e04b (diff) |
Merge pull request #1324 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/services/fetch_resource_service_spec.rb')
-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 } |