test/mollie/method_test.rb in mollie-api-ruby-4.7.1 vs test/mollie/method_test.rb in mollie-api-ruby-4.14.0

- old
+ new

@@ -6,10 +6,11 @@ attributes = { id: 'creditcard', description: 'Credit card', minimum_amount: { value: '0.01', currency: 'EUR' }, maximum_amount: { value: '2000.00', currency: 'EUR' }, + status: 'approved', image: { 'size1x' => 'https://www.mollie.com/external/icons/payment-methods/creditcard.png', 'size2x' => 'https://www.mollie.com/external/icons/payment-methods/creditcard%402x.png', 'svg' => 'https://www.mollie.com/external/icons/payment-methods/creditcard.svg' } @@ -21,12 +22,24 @@ assert_equal 'Credit card', method.description assert_equal BigDecimal('0.01'), method.minimum_amount.value assert_equal 'EUR', method.minimum_amount.currency assert_equal BigDecimal('2000.00'), method.maximum_amount.value assert_equal 'EUR', method.maximum_amount.currency + assert_equal 'approved', method.status assert_equal 'https://www.mollie.com/external/icons/payment-methods/creditcard.png', method.normal_image assert_equal 'https://www.mollie.com/external/icons/payment-methods/creditcard%402x.png', method.bigger_image assert_equal 'https://www.mollie.com/external/icons/payment-methods/creditcard.svg', method.image['svg'] + end + + def test_all_available + stub_request(:get, 'https://api.mollie.com/v2/methods/all') + .to_return(status: 200, body: read_fixture('methods/all.json'), headers: {}) + + available_methods = Method.all_available + assert_equal 3, available_methods.size + + ideal_method = available_methods.first + assert_equal "pending-boarding", ideal_method.status end def test_pricing stub_request(:get, 'https://api.mollie.com/v2/methods/creditcard?include=pricing') .to_return(status: 200, body: read_fixture('methods/get-includes-pricing.json'), headers: {})