Sha256: a7c071cebf148a94dbf0abc751337242f8e244667aa1d081c07fed887f70ac21
Contents?: true
Size: 1.33 KB
Versions: 5
Compression:
Stored size: 1.33 KB
Contents
require 'spec_helper' describe 'ca-bundle.crt' do it 'should be able to connect to the 4me REST API' do WebMock.allow_net_connect! client = Sdk4me::Client.new(api_token: 'invalid', max_retry_time: -1) result = {} # no exception concerning the certificate expect { result[:response] = client.get('me') }.not_to raise_error response = result[:response] expect(response.valid?).to be_falsey # expecting 401 error expect(response.message).to eq('401: Bad credentials') end it 'should be able to connect to the 4me REST API (access token)' do WebMock.allow_net_connect! client = Sdk4me::Client.new(access_token: 'invalid', max_retry_time: -1) result = {} # no exception concerning the certificate expect { result[:response] = client.get('me') }.not_to raise_error response = result[:response] expect(response.valid?).to be_falsey # expecting 401 error expect(response.message).to eq('401: Bad credentials') end it 'should be able to connect to S3' do WebMock.allow_net_connect! http = Net::HTTP.new('sdk4me-eu.s3-eu-west-1.amazonaws.com', 443) http.read_timeout = 1 http.use_ssl = true # no SSL error please expect { http.start { |transport| transport.request(Net::HTTP::Get.new('/exports/20141107/')) } }.to never_raise(OpenSSL::SSL::SSLError) end end
Version data entries
5 entries across 5 versions & 1 rubygems