Sha256: cc19008d399b6687e1962e47b7e6b825c9ce85b400e67beeed081302a6a485ab

Contents?: true

Size: 834 Bytes

Versions: 1

Compression:

Stored size: 834 Bytes

Contents

require "spec_helper"

describe AdaptivePayments::ExecutePaymentRequest do
  it_behaves_like "a RequestEnvelope"

  subject         { AdaptivePayments::ExecutePaymentRequest }

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

  let(:request) do
    AdaptivePayments::ExecutePaymentRequest.new(
      :action_type     => "PAY",
      :pay_key         => "ABCD-1234",
      :funding_plan_id => "funding123"
    )
  end

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

  it "maps #action_type to ['actionType']" do
    expect(json["actionType"]).to eq("PAY")
  end

  it "maps #pay_key to ['payKey']" do
    expect(json["payKey"]).to eq("ABCD-1234")
  end

  it "maps #funding_plan_id to ['fundingPlanId']" do
    expect(json["fundingPlanId"]).to eq("funding123")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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