Sha256: 2527a92739df77d2c8cbe1ad0dc3c29d7723b1402f102c370228149960b42053
Contents?: true
Size: 1.4 KB
Versions: 2
Compression:
Stored size: 1.4 KB
Contents
require 'spec_helper' describe Datatrans::XML::Transaction::Request do describe "Proxy" do describe "configured" do before(:each) do @datatrans = Datatrans::Config.new( :merchant_id => '1100000000', :sign_key => 'd777c17ba2010282c2d2350a68b441ca07a799d294bfaa630b7c8442207c0b69703cc55775b0ca5a4e455b818a9bb10a43669c0c20ce31f4a43f10e0cabb9525', :key => "value", :proxy => { :http_proxyaddr => "proxy.com", :http_proxyport => 80, :http_proxyuser => "hans", :http_proxpass => "xxx", }, :environment => :development ) end it "forward those options to HTTParty" do request = Datatrans::XML::Transaction::Request.new(@datatrans, {}) expect(HTTParty).to receive(:post).with('lirum', :params => {:foo => :bar}, :http_proxpass => 'xxx', :http_proxyuser => 'hans', :http_proxyaddr => 'proxy.com', :http_proxyport => 80) request.post('lirum', :params => {:foo => :bar}) end end describe "not configured" do it "should not add any proxy settings" do request = Datatrans::XML::Transaction::Request.new(@datatrans, {}) expect(HTTParty).to receive(:post).with('lirum', :params => {:foo => :bar}) request.post('lirum', :params => {:foo => :bar}) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
datatrans-4.0.1 | spec/xml/request_spec.rb |
datatrans-4.0.0 | spec/xml/request_spec.rb |