Sha256: 8459e82a5e8e29afcf98ff7d636a40dea005ebc5eb31cb9c2ca4ec0afa1c1e94

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 Bytes

Contents

require "spec_helper"

describe AdaptivePayments::PreapprovalDetailsRequest do
  it_behaves_like "a RequestEnvelope"

  subject         { AdaptivePayments::PreapprovalDetailsRequest }

  describe '#operation' do
    subject { super().operation }
    it { is_expected.to eq(:PreapprovalDetails) }
  end

  let(:request) do
    AdaptivePayments::PreapprovalDetailsRequest.new(
      :preapproval_key     => "ABCDEFG-1234",
      :get_billing_address => true
    )
  end

  let(:json) { JSON.parse(request.to_json) }

  it "maps #preapproval_key to ['preapprovalKey']" do
    expect(json["preapprovalKey"]).to eq("ABCDEFG-1234")
  end

  it "maps #get_billing_address to ['getBillingAddress']" do
    expect(json["getBillingAddress"]).to eq(true)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
creative-pp-adaptive-1.1.1 spec/public/preapproval_details_request_spec.rb