Sha256: 56b951aa114d61240acaff4d05fe44d4914688f51229637fa7634531bd1f978a

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

require 'helper'

module Mollie
  module API
    module Object
      class MethodTest < Test::Unit::TestCase
        def test_setting_attributes
          attributes = {
              id:          "creditcard",
              description: "Credit card",
              amount:      {
                  'minimum' => "0.31",
                  'maximum' => "10000.00"
              },
              image:       {
                  'normal' => "https://www.mollie.com/images/payscreen/methods/creditcard.png",
                  'bigger' => "https://www.mollie.com/images/payscreen/methods/creditcard@2x.png"
              }
          }

          method = Method.new(attributes)

          assert_equal "creditcard", method.id
          assert_equal "Credit card", method.description
          assert_equal BigDecimal.new("0.31"), method.minimum_amount
          assert_equal BigDecimal.new("10000.0"), method.maximum_amount
          assert_equal "https://www.mollie.com/images/payscreen/methods/creditcard.png", method.normal_image
          assert_equal "https://www.mollie.com/images/payscreen/methods/creditcard@2x.png", method.bigger_image
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mollie-api-ruby-2.2.1 test/mollie/api/object/method_test.rb
mollie-api-ruby-2.2.0 test/mollie/api/object/method_test.rb
mollie-api-ruby-2.1.0 test/mollie/api/object/method_test.rb
mollie-api-ruby-2.0.1 test/mollie/api/object/method_test.rb
mollie-api-ruby-2.0.0 test/mollie/api/object/method_test.rb