Sha256: 4650380ec582c628a52a9598d08301996f8ed2e1377c4b3266f27bdc4f4a5af1

Contents?: true

Size: 887 Bytes

Versions: 1

Compression:

Stored size: 887 Bytes

Contents

require "spec_helper"

include PayPal::Invoice

describe PayPal::Invoice::Invoice do
  describe "#cancel" do
    context "when successful" do
      use_vcr_cassette "invoice/cancel/success"#, :record => :all

      let(:invoice) {
        PayPal::Invoice::Invoice.new(
          :merchant_email => 'chardy_1345003248_per@gmail.com',
          :payer_email => 'chardy_1345003165_per@gmail.com',
          :item_list => {
            :item => [
              {
                :name => 'iPhone 5',
                :quantity => 1,
                :unit_price => 1000.0
              }
            ]
          },
          :currency_code => 'USD',
          :payment_terms => 'Net30'
        )
      }

      before do
        invoice.create_and_send
      end

      subject { invoice.cancel }

      its(:success?) { should be_true }
      its(:valid?) { 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/invoice/cancel_spec.rb