Sha256: 5f07b7da2fcc3b19f769f461ad01a01b82de628a8aed52eebb276a1974687b85

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require "spec_helper"

describe PayPal::Recurring::Response::Profile do
  context "when successful" do
    use_vcr_cassette "create_profile/success"

    subject {
      ppr = PayPal::Recurring.new({
        :amount      => "9.00",
        :currency    => "USD",
        :description => "Awesome - Monthly Subscription",
        :ipn_url     => "http://example.com/paypal/ipn",
        :frequency   => 1,
        :token       => "EC-2UK36172XH723314S",
        :period      => :monthly,
        :reference   => "1234",
        :payer_id    => "WTTS5KC2T46YU",
        :start_at    => Time.now,
        :failed      => 1,
        :outstanding => :next_billing
      })
      ppr.create_recurring_profile
    }

    it { should be_valid }

    its(:profile_id) { should == "I-89LD5VEHEVK4" }
    its(:status) { should == "ActiveProfile" }
    its(:errors) { should be_empty }
  end

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

    it { should_not be_valid }
    its(:errors) { should have(5).items }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
paypal-recurring-0.1.1 spec/paypal/response/create_recurring_profile_spec.rb
paypal-recurring-0.1.0 spec/paypal/response/create_recurring_profile_spec.rb