Sha256: 72dc9108d963b80b299b7e2422c22759fa57d45dafa8cbbe546003fe4559d655

Contents?: true

Size: 595 Bytes

Versions: 3

Compression:

Stored size: 595 Bytes

Contents

require 'helper'

module Mollie
  class Payment
    class RefundTest < Test::Unit::TestCase
      def test_kind_of_refund
        refund = Mollie::Payment::Refund.new({})
        assert_kind_of Mollie::Refund, refund
      end

      def test_list_refunds
        stub_request(:get, "https://api.mollie.com/v2/payments/pay-id/refunds")
          .to_return(:status => 200, :body => %{{"_embedded" : { "refunds" : [{"id":"re-id"}]}}}, :headers => {})

        refunds = Mollie::Payment::Refund.all(payment_id: "pay-id")

        assert_equal "re-id", refunds.first.id
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mollie-api-ruby-4.0.0.pre.alpha.2 test/mollie/payment/refund_test.rb
mollie-api-ruby-4.0.0 test/mollie/payment/refund_test.rb
mollie-api-ruby-4.0.0.pre.alpha.1 test/mollie/payment/refund_test.rb