Sha256: 16b27423f8b01e7ef8e2ff33216219102f447c2ebd53672395cda5d211aa7a2a
Contents?: true
Size: 733 Bytes
Versions: 6
Compression:
Stored size: 733 Bytes
Contents
require 'spec_helper' describe Intelipost::Api do shared_examples "intelipost_request" do it { allow(Intelipost::Facade).to receive(request_method).and_raise SocketError response = Intelipost::Facade.send("#{request_method}_with_log",'http://test.com', 'apikey', {}) expect(response.status).to eq "ERROR" expect(response.messages.first["type"]).to eq "ERROR" expect(response.messages.first["text"]).to eq "Connection Timeout" expect(response.messages.first["key"]).to eq "timeout" } end [:get, :post].each do |method| describe "Timeout for #{method} request" do it_behaves_like "intelipost_request" do let(:request_method) { method } end end end end
Version data entries
6 entries across 6 versions & 1 rubygems