Sha256: 8ceba128b98ffdf21ea0ad9ac0e5b665edeb3c38f4ad56c224adf94edcebf02a

Contents?: true

Size: 654 Bytes

Versions: 16

Compression:

Stored size: 654 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

16 entries across 16 versions & 1 rubygems

Version Path
eac_rails_utils-0.13.0 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.12.3 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.12.2 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.12.1 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.12.0 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.11.6 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.11.5 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.11.4 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.11.3 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.11.2 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.11.1 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.11.0 test/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.10.1 test/app/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.10.0 test/app/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.9.1 test/app/helpers/eac_rails_utils/formatter_helper_test.rb
eac_rails_utils-0.9.0 test/app/helpers/eac_rails_utils/formatter_helper_test.rb