Sha256: b7c45c1443ea7069f9f1f76f0dd44ae50371da90aeef65683522a2a917881b5b

Contents?: true

Size: 970 Bytes

Versions: 7

Compression:

Stored size: 970 Bytes

Contents

require "spec_helper"

describe PayPal::Recurring::Response::Checkout do
  context "when successful" do
    use_vcr_cassette "checkout/success"

    subject {
      ppr = PayPal::Recurring.new({
        :return_url         => "http://example.com/thank_you",
        :cancel_url         => "http://example.com/canceled",
        :ipn_url            => "http://example.com/paypal/ipn",
        :description        => "Awesome - Monthly Subscription",
        :amount             => "9.00",
        :currency           => "USD"
      })

      ppr.checkout
    }

    its(:valid?) { should be_true }
    its(:errors) { should be_empty }
    its(:checkout_url) { should == "#{PayPal::Recurring.site_endpoint}?cmd=_express-checkout&token=EC-7B902269MT603740W" }
  end

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

    its(:valid?) { should be_false }
    its(:errors) { should have(3).items }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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