Sha256: 29cf74a4def38d6ec9505f788bb73b2290164398f915b4a1b3e302d1d9fec5e0

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

require "spec_helper"

module ShipCompliant
  describe CheckCompliance do

    before { savon.mock! }
    after { savon.unmock! }

    context "of_sales_order" do
      let(:message) do
        {
          'Request' => {
            'Security' => {
              'PartnerKey' => 'abc-123',
              'Username' => 'bob@example.com',
              'Password' => 'secret'
            },
            'IncludeSalesTax' => true,
            'CustomerKey' => 'CUST-1',
            'FooBar' => {
              'Baz' => false
            }
          }
        }
      end
      let(:response) { File.read('spec/fixtures/check_compliance.xml') }

      it "queries the client with product information" do
        savon.expects(:check_compliance_of_sales_order_with_address_validation)
          .with(message: message).returns(response)

        result = CheckCompliance.of_sales_order({
          include_sales_tax: true,
          customer_key: 'CUST-1',
          foo_bar: { baz: false }
        })

        result.should be_kind_of(CheckComplianceResult)
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ship_compliant-0.2.0 spec/lib/ship_compliant/check_compliance_spec.rb
ship_compliant-0.1.2 spec/lib/ship_compliant/check_compliance_spec.rb
ship_compliant-0.1.1 spec/lib/ship_compliant/check_compliance_spec.rb
ship_compliant-0.1.0 spec/lib/ship_compliant/check_compliance_spec.rb