Sha256: 11a5b6cb6db3d1f55b5ee551d7f3816b2f102b960b4def271474a320ac30dabf

Contents?: true

Size: 794 Bytes

Versions: 12

Compression:

Stored size: 794 Bytes

Contents

require 'spec_helper'

describe Conekta::Card do
  include_context "API 1.0.0"
  let(:customer_data) do
    {
      email: "hola@hola.com",
      name:  "John Constantine",
      cards: ["tok_test_visa_4242"]
    }
  end

  let(:customer) do
    Conekta::Customer.create(customer_data)
  end

  let(:card) { customer.cards.first }

  context "deleting cards" do
    it "successful card delete" do
      card.delete

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

  context "updating cards" do
    it "successful card update" do
      card.update(active: false)

      expect(card.active).to eq(false)
    end

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

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
conekta-2.6.0 spec/conekta/1.0.0/card_spec.rb
conekta-tiempometa-2.4.2 spec/conekta/1.0.0/card_spec.rb
conekta-2.5.0 spec/conekta/1.0.0/card_spec.rb
conekta-2.4.2 spec/conekta/1.0.0/card_spec.rb
conekta-2.4.1 spec/conekta/1.0.0/card_spec.rb
conekta-2.4.0 spec/conekta/1.0.0/card_spec.rb
conekta-2.3.0 spec/conekta/1.0.0/card_spec.rb
conekta-2.0.0 spec/conekta/1.0.0/card_spec.rb
conekta-1.1.3 spec/conekta/1.0.0/card_spec.rb
conekta-1.1.2 spec/conekta/1.0.0/card_spec.rb
conekta-1.1.1 spec/conekta/1.0.0/card_spec.rb
conekta-1.1.0 spec/conekta/1.0.0/card_spec.rb