test/razorpay/test_payment.rb in razorpay-1.0.3 vs test/razorpay/test_payment.rb in razorpay-1.1.0
- old
+ new
@@ -7,11 +7,11 @@
class RazorpayPaymentTest < Minitest::Test
def setup
@payment_id = 'fake_payment_id'
# Any request that ends with payments/payment_id
- stub_get(/payments\/#{Regexp.quote(@payment_id)}$/, 'fake_payment')
+ stub_get(%r{payments\/#{Regexp.quote(@payment_id)}$}, 'fake_payment')
stub_get(/payments$/, 'payment_collection')
end
def test_payment_should_be_defined
refute_nil Razorpay::Payment
@@ -24,10 +24,10 @@
end
def test_all_payments
payments = Razorpay::Payment.all
assert_instance_of Razorpay::Collection, payments, 'Payments should be an array'
- assert payments.items.size > 0, 'Payments should be more than one'
+ assert !payments.items.empty?, 'Payments should be more than one'
end
def test_all_payments_with_options
query = { 'count' => 1 }
stub_get(/payments\?count=1$/, 'payment_collection_with_one_payment')