Sha256: 94dd93aee0926f997fb63d241f83372a48f77985017c699909734fc1c5d3fa9b

Contents?: true

Size: 1.48 KB

Versions: 3

Compression:

Stored size: 1.48 KB

Contents

require "spec_helper"

describe PayPal::Recurring::Response::ManageProfile do
  let(:paypal) { PayPal::Recurring.new(:profile_id => "I-W4FNTE6EXJ2W") }

  context "suspending" do
    context "when successful" do
      use_vcr_cassette "profile/suspend/success"
      subject { paypal.suspend }

      it { should be_success }
      it { should be_valid }
    end

    context "when failure" do
      use_vcr_cassette "profile/suspend/failure"
      subject { paypal.suspend }

      it { should_not be_success }
      it { should_not be_valid }
      its(:errors) { should have(1).item }
    end
  end

  context "reactivating" do
    context "when successful" do
      use_vcr_cassette "profile/reactivate/success"
      subject { paypal.reactivate }

      it { should be_success }
      it { should be_valid }
    end

    context "when failure" do
      use_vcr_cassette "profile/reactivate/failure"
      subject { paypal.reactivate }

      it { should_not be_success }
      it { should_not be_valid }
      its(:errors) { should have(1).item }
    end
  end

  context "cancelling" do
    context "when successful" do
      use_vcr_cassette "profile/cancel/success"
      subject { paypal.cancel }

      it { should be_success }
      it { should be_valid }
    end

    context "when failure" do
      use_vcr_cassette "profile/cancel/failure"
      subject { paypal.cancel }

      it { should_not be_success }
      it { should_not be_valid }
      its(:errors) { should have(1).item }
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
didil-paypal-recurring-1.1.1 spec/paypal/response/manage_profile_spec.rb
paypal-recurring-1.1.0 spec/paypal/response/manage_profile_spec.rb
paypal-recurring-1.0.0 spec/paypal/response/manage_profile_spec.rb