Sha256: 7ea62bdd78c7230dbf898b64458d6f7abeaca6ec46f2932b102a5308d6857867

Contents?: true

Size: 753 Bytes

Versions: 6

Compression:

Stored size: 753 Bytes

Contents

require "spec_helper"

describe AdaptivePayments::ExecutePaymentRequest do
  it_behaves_like "a RequestEnvelope"

  subject         { AdaptivePayments::ExecutePaymentRequest }
  its(:operation) { should == :ExecutePayment }

  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
    json["actionType"].should == "PAY"
  end

  it "maps #pay_key to ['payKey']" do
    json["payKey"].should == "ABCD-1234"
  end

  it "maps #funding_plan_id to ['fundingPlanId']" do
    json["fundingPlanId"].should == "funding123"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pp-adaptive-1.0.0 spec/public/execute_payment_request_spec.rb
pp-adaptive-0.0.6 spec/public/execute_payment_request_spec.rb
pp-adaptive-0.0.5 spec/public/execute_payment_request_spec.rb
pp-adaptive-0.0.4 spec/public/execute_payment_request_spec.rb
pp-adaptive-0.0.3 spec/public/execute_payment_request_spec.rb
pp-adaptive-0.0.2 spec/public/execute_payment_request_spec.rb