Sha256: 19c6ea1d3dc5a71634eb9db6f3a048e0bc95414da07f859f114011682cbf373c

Contents?: true

Size: 919 Bytes

Versions: 1

Compression:

Stored size: 919 Bytes

Contents

require 'spec_helper'

include PayPal::AdaptivePayments

describe PayPal::AdaptivePayments::PaymentOptions do
  let(:receiver_email) { 'chardy_1345003248_per@gmail.com' }
  let(:receiver) { Receiver.new(:email => receiver_email, :amount => 40.0) }
  let(:receiver_list) { ReceiverList.new(:receivers => [receiver]) }
  let(:payment) {
    PayPal::AdaptivePayments::Payment.new(
      :receiver => receiver,
      :currency_code => 'USD',
      :cancel_url => 'http://example.com/cancel',
      :return_url => 'http://example.com/thank_you'
    )
  }

  describe "#get" do
    context "when successful" do
      use_vcr_cassette "adaptive_payments/payment_options/get/success"#, :record => :all

      before { payment.create }

      let(:payment_options) {
        PaymentOptions.new(:pay_key => payment.pay_key)
      }

      subject { payment_options.get }

      its(:success?) { should be_true }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paypal-payment-0.1.2 spec/paypal/adaptive_payments/payment_options/get_spec.rb