Sha256: aee85e8c5b3c4a53d1fb8084ae21b26134446fd5a8fa08ec1ba4fec63ca1b031
Contents?: true
Size: 478 Bytes
Versions: 4
Compression:
Stored size: 478 Bytes
Contents
module Helpers def stub_http(options = {}) response = options[:response] || Net::HTTPSuccess.new('1.2', '200', 'OK') allow(response).to receive(:body).with(options[:body] || '{"id":"1234"}') http = double( :post => response, :read_timeout= => nil, :open_timeout= => nil, :ca_file= => nil, :verify_mode= => nil, :use_ssl= => nil ) allow(Net::HTTP).to receive(:new).and_return(http) http end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
lens-0.0.10 | spec/support/helpers.rb |
lens-0.0.9 | spec/support/helpers.rb |
lens-0.0.8 | spec/support/helpers.rb |
lens-0.0.7 | spec/support/helpers.rb |