Sha256: 21ea8692d203e873fae7479d7eaa37dfd1d8291ac12f30aea7d498070fe8a0a0

Contents?: true

Size: 810 Bytes

Versions: 2

Compression:

Stored size: 810 Bytes

Contents

require_relative '../../test_helper'

module PagarMe
  class PaymentLinkTest < PagarMeTestCase
    should 'be able to create a payment_link' do
      payment_link = PagarMe::PaymentLink.create payment_link_params
      assert_equal payment_link.amount, 1000
    end

    should 'be able to cancel a payment_link' do
      payment_link = PagarMe::PaymentLink.create payment_link_params
      payment_link.cancel
      assert_equal payment_link.status, 'canceled'
    end

    should 'be able to search by short_id' do
      pl = PagarMe::PaymentLink.create payment_link_params
      payment_links = PagarMe::PaymentLink.find short_id: pl.short_id

      assert payment_links.size > 0
      payment_links.each do |payment_link|
        assert_equal payment_link.short_id, pl.short_id
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pagarme-2.4.0 test/pagarme/resources/payment_link.rb
pagarme-2.3.0 test/pagarme/resources/payment_link.rb