Sha256: de0d959e94ff6e82c792362eb16b8e635857f757afa1a2a0eee267aed7cdc866

Contents?: true

Size: 1.21 KB

Versions: 5

Compression:

Stored size: 1.21 KB

Contents

require 'helper'

module Mollie
  module API
    module Object
      class CustomerTest < Test::Unit::TestCase
        def test_setting_attributes
          attributes = {
              id:                    'cst_vsKJpSsabw',
              mode:                  'test',
              name:                  'Customer A',
              email:                 'customer@example.org',
              locale:                'nl_NL',
              metadata:              { my_field: 'value' },
              recently_used_methods: 'creditcard',
              created_datetime:      '2016-04-06T13:23:21.0Z'
          }

          customer = Customer.new(attributes)

          assert_equal 'cst_vsKJpSsabw', customer.id
          assert_equal 'test', customer.mode
          assert_equal 'Customer A', customer.name
          assert_equal 'customer@example.org', customer.email
          assert_equal 'nl_NL', customer.locale
          assert_equal ['creditcard'], customer.recently_used_methods
          assert_equal Time.parse('2016-04-06T13:23:21.0Z'), customer.created_datetime

          assert_equal 'value', customer.metadata.my_field
          assert_equal nil, customer.metadata.non_existing
        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/customer_test.rb
mollie-api-ruby-2.2.0 test/mollie/api/object/customer_test.rb
mollie-api-ruby-2.1.0 test/mollie/api/object/customer_test.rb
mollie-api-ruby-2.0.1 test/mollie/api/object/customer_test.rb
mollie-api-ruby-2.0.0 test/mollie/api/object/customer_test.rb