Sha256: bb63ca6bcd7c6c1ab5d9401ed9ecc7879578763d12afe96a0eee47516d61cc04

Contents?: true

Size: 653 Bytes

Versions: 3

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true
require 'test_helper'

module EacRailsUtils
  class FormatterHelperTest < ActionView::TestCase
    include ::EacRailsUtils::FormatterHelper

    test 'should convert BRL currency to float' do
      brl_currency = { a: '1', b: '1,2', c: '1,23', d: '123.456.789,01',
                       e: 'R$1,23', f: 'R$ 123.4,56' }
      float_currency = { a: 1, b: 1.2, c: 1.23, d: 123_456_789.01,
                         e: 1.23, f: 123_4.56 }

      brl_currency.each do |k, v|
        assert_equal float_currency[k], brl_currency_to_float(v),
                     "#{v} should be #{float_currency[k]}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eac_rails_utils-0.8.0 test/app/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.7.1 test/app/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.7.0 test/app/helpers/eac_rails_utils/formatter_helper_test.rb