Sha256: 2d71479a21f2bf96b742aa228ac8f45e226695721dd59d28ce732de8d7b0fa6d

Contents?: true

Size: 799 Bytes

Versions: 7

Compression:

Stored size: 799 Bytes

Contents

require 'spec_helper'

describe Conekta::PaymentSource do
  include_context "API 2.0.0"
  include_context "customer"

  let(:customer) { Conekta::Customer.create(customer_data) }
  let(:payment_source)   { customer.payment_sources.first }

  context "deleting payment_sources" do
    it "successful source delete" do
      payment_source.delete

      expect(payment_source.deleted).to eq(true)
    end
  end

  context "updating payment_sources" do
    it "successful payment_source update" do
      payment_source.update(exp_month: 12)

      expect(payment_source.exp_month).to eq("12")
    end

    it "unsuccessful payment_source update" do
      expect {
        payment_source.update(token_id: "tok_test_visa_4241")
      }.to raise_error(Conekta::ParameterValidationError)
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
conekta-2.6.0 spec/conekta/2.0.0/source_spec.rb
conekta-tiempometa-2.4.2 spec/conekta/2.0.0/source_spec.rb
conekta-2.5.0 spec/conekta/2.0.0/source_spec.rb
conekta-2.4.2 spec/conekta/2.0.0/source_spec.rb
conekta-2.4.1 spec/conekta/2.0.0/source_spec.rb
conekta-2.4.0 spec/conekta/2.0.0/source_spec.rb
conekta-2.3.0 spec/conekta/2.0.0/source_spec.rb