Sha256: 56b3eea4ddbf4dfa736b9561429625836c78dab7b0016e89371d2fa7067d7599
Contents?: true
Size: 961 Bytes
Versions: 4
Compression:
Stored size: 961 Bytes
Contents
require 'test_helper' require 'razorpay/payment' require 'razorpay/refund' module Razorpay # Tests for Razorpay::Refund class RazorpayRefundTest < Minitest::Test def setup @payment_id = 'fake_payment_id' stub_get(/payments\/#{Regexp.quote(@payment_id)}$/, 'fake_payment') end def test_refund_should_be_defined refute_nil Razorpay::Refund end def test_fetch_all_refunds stub_get(%r{/payments/#{@payment_id}/refunds$}, 'refund_collection') refunds = Razorpay::Payment.fetch(@payment_id).refunds.all assert_instance_of Razorpay::Collection, refunds end def test_fetch_specific_refund refund_id = 'fake_refund_id' stub_get(%r{payments/#{@payment_id}/refunds/#{refund_id}$}, 'fake_refund') refund = Razorpay::Payment.fetch(@payment_id).refunds.fetch('fake_refund_id') assert_instance_of Razorpay::Refund, refund assert_equal refund.id, refund_id end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
razorpay-1.0.3 | test/razorpay/test_refund.rb |
razorpay-1.0.2 | test/razorpay/test_refund.rb |
razorpay-1.0.1 | test/razorpay/test_refund.rb |
razorpay-1.0.0 | test/razorpay/test_refund.rb |