Sha256: 5dc0a9f24ea947d9ddf1afef76d3d20bae3db33bfe7a16c962cbd022c7b91604

Contents?: true

Size: 774 Bytes

Versions: 35

Compression:

Stored size: 774 Bytes

Contents

require 'test_helper'

class Kaui::InvoiceTest < ActiveSupport::TestCase

  test 'can convert to money' do
    invoice = Kaui::Invoice.new(:amount => 12.42, :balance => 54.32, :refund_adj => 48, :credit_adj => 1.2, :currency => 'USD')

    assert_equal 1242, invoice.amount_to_money.cents
    assert_equal 'USD', invoice.amount_to_money.currency_as_string

    assert_equal 5432, invoice.balance_to_money.cents
    assert_equal 'USD', invoice.balance_to_money.currency_as_string

    assert_equal 4800, invoice.refund_adjustment_to_money.cents
    assert_equal 'USD', invoice.refund_adjustment_to_money.currency_as_string

    assert_equal 120, invoice.credit_adjustment_to_money.cents
    assert_equal 'USD', invoice.credit_adjustment_to_money.currency_as_string
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
kaui-2.0.4 test/unit/kaui/invoice_test.rb
kaui-2.0.3 test/unit/kaui/invoice_test.rb
kaui-2.0.2 test/unit/kaui/invoice_test.rb
kaui-2.0.1 test/unit/kaui/invoice_test.rb
kaui-2.0.0 test/unit/kaui/invoice_test.rb
kaui-1.4.1 test/unit/kaui/invoice_test.rb
kaui-1.4.0 test/unit/kaui/invoice_test.rb
kaui-1.3.0 test/unit/kaui/invoice_test.rb
kaui-1.2.0 test/unit/kaui/invoice_test.rb
kaui-1.1.0 test/unit/kaui/invoice_test.rb
kaui-1.0.0 test/unit/kaui/invoice_test.rb
kaui-0.16.2 test/unit/kaui/invoice_test.rb
kaui-0.16.1 test/unit/kaui/invoice_test.rb
kaui-0.16.0 test/unit/kaui/invoice_test.rb
kaui-0.15.5 test/unit/kaui/invoice_test.rb
kaui-0.15.4 test/unit/kaui/invoice_test.rb
kaui-0.15.3 test/unit/kaui/invoice_test.rb
kaui-0.15.2 test/unit/kaui/invoice_test.rb
kaui-0.15.1 test/unit/kaui/invoice_test.rb
kaui-0.15.0 test/unit/kaui/invoice_test.rb