Sha256: ab2d8d78edc1a2d9f8158e3fb3f824df86dbbdf44bfa8fee90c8b4e2f348fb7e

Contents?: true

Size: 1.45 KB

Versions: 7

Compression:

Stored size: 1.45 KB

Contents

require "spec_helper"

describe PayPal::Recurring::Response::Details do
  context "when successful" do
    use_vcr_cassette "details/success"

    subject {
      ppr = PayPal::Recurring.new(:token => "EC-7B902269MT603740W")
      ppr.checkout_details
    }

    it { should be_valid }
    it { should be_success }

    its(:errors) { should be_empty }
    its(:status) { should == "PaymentActionNotInitiated" }
    its(:email) { should == "buyer_1308979708_per@simplesideias.com.br" }
    its(:requested_at) { should be_a(Time) }
    its(:email) { should == "buyer_1308979708_per@simplesideias.com.br" }
    its(:payer_id) { should == "WTTS5KC2T46YU" }
    its(:payer_status) { should == "verified" }
    its(:country) { should == "US" }
    its(:currency) { should == "USD" }
    its(:description) { should == "Awesome - Monthly Subscription" }
    its(:ipn_url) { should == "http://example.com/paypal/ipn" }
    its(:agreed?) { should be_true }
  end

  context "when cancelled" do
    use_vcr_cassette "details/cancelled"
    subject {
      ppr = PayPal::Recurring.new(:token => "EC-365619347A138351P")
      ppr.checkout_details
    }

    it { should be_valid }
    it { should be_success }

    its(:agreed?) { should be_false }
  end

  context "when failure" do
    use_vcr_cassette("details/failure")
    subject { PayPal::Recurring.new.checkout_details }

    it { should_not be_valid }
    it { should_not be_success }

    its(:errors) { should have(1).item }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
paypal-recurring-0.1.6 spec/paypal/response/checkout_details_spec.rb
paypal-recurring-0.1.5 spec/paypal/response/checkout_details_spec.rb
paypal-recurring-0.1.4 spec/paypal/response/checkout_details_spec.rb
paypal-recurring-0.1.3 spec/paypal/response/checkout_details_spec.rb
paypal-recurring-0.1.2 spec/paypal/response/checkout_details_spec.rb
paypal-recurring-0.1.1 spec/paypal/response/checkout_details_spec.rb
paypal-recurring-0.1.0 spec/paypal/response/checkout_details_spec.rb