Sha256: 44bad6e377529370385996a04331aede4d80430ceee2307dff4d447bd284fbda
Contents?: true
Size: 1.02 KB
Versions: 5
Compression:
Stored size: 1.02 KB
Contents
require "spec_helper" describe Ecommerce::Request do describe "#run" do subject { described_class.new({ method: 'post', params: {}, url: Ecommerce.configuration.url, user_agent: 'My Test User-Agent', authorization_hash: 'my-auth-hash' }) } it "does a request using Typhoeus::Request" do expect(Typhoeus::Request).to receive(:new).with("http://sandbox.ecommerce.myfreecomm.com.br", { method: "post", params: {}, headers: { "Accept" => "application/json", "Content-Type" => "application/json", "User-Agent" => "My Test User-Agent", "Authorization" => "Basic my-auth-hash" }, accept_encoding: "gzip" }).and_return(double(run: true, response: true)) subject.run end it "invokes Typhoeus::Request#run" do expect_any_instance_of(Typhoeus::Request).to receive(:run) subject.run end it "invokes Typhoeus::Request#response" do allow_any_instance_of(Typhoeus::Request).to receive(:run) expect_any_instance_of(Typhoeus::Request).to receive(:response) subject.run end end end
Version data entries
5 entries across 5 versions & 1 rubygems