Sha256: c3c5bdb61e1407ac01d18e83d617e7ade9cadb639db27d44ab2e16350841103d

Contents?: true

Size: 560 Bytes

Versions: 8

Compression:

Stored size: 560 Bytes

Contents

require 'test_helper'

module Razorpay
  # Tests for Razorpay::Entity
  class ErrorTest < Minitest::Test
    def setup
      @payment_id = 'fake_payment_id'
      stub_get(%r{payments\/#{Regexp.quote(@payment_id)}$}, 'fake_payment')
    end

    def test_bad_request_error
      stub_post(%r{payments/#{@payment_id}/capture$}, 'bad_request_error', 'amount=5')
      assert_raises Razorpay::BadRequestError, 'It must raise BadRequestError' do
        payment = Razorpay::Payment.fetch(@payment_id)
        payment.capture(amount: 5)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
razorpay-2.4.1 test/razorpay/test_errors.rb
razorpay-2.4.0 test/razorpay/test_errors.rb
razorpay-2.3.0 test/razorpay/test_errors.rb
razorpay-2.2.0 test/razorpay/test_errors.rb
razorpay-2.1.0 test/razorpay/test_errors.rb
razorpay-2.1.0.pre test/razorpay/test_errors.rb
razorpay-2.0.1 test/razorpay/test_errors.rb
razorpay-2.0.0 test/razorpay/test_errors.rb