Sha256: aed7086b4733f58ee519561cc423364605833932255112787ba4abeba7e9ea31

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 KB

Contents

=begin
  require 'spec_helper'

  describe 'Numeric conversions' do
    describe 'BigDecimalBackup conversions' do
      # setup it vars to have the conversion tested, value: 1999 (nineteen ninety nine)
      pt_br = '1.999,00'
      en_us = '1,999.00'

      # Value like the card operator uses
      operator_expected_value = '199900'
      operator_value = '199900'
      decimal_expected_value = BigDecimal.new '1999.00'

      # it is the Rails conversion form the Form for Decimal input
      decimal_obj_pt_br = BigDecimal.new(pt_br)
      decimal_obj_en_us = BigDecimal.new(en_us.remove('.').remove(','))

      # Conversions
      pt_br_converted = Currency.to_operator_str decimal_obj_pt_br
      en_us_converted = Currency.to_operator_str decimal_obj_en_us
      decimal_converted = Currency.to_decimal operator_value

      context 'Operator Format value' do

      end

      it 'should be running correctly' do
        status = NitroPay::Status.new
        expect(status.http_code).to equal(200)
        expect(status.api_code).to equal(200)
        expect(status.message).not_to be nil
      end
    end
  end
=end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
nitro_pay-1.0.10 spec/nitro_pay/conversions_spec.rb
nitro_pay-1.0.9 spec/nitro_pay/conversions_spec.rb
nitro_pay-1.0.8 spec/nitro_pay/conversions_spec.rb
nitro_pay-1.0.7 spec/nitro_pay/conversions_spec.rb
nitro_pay-1.0.6 spec/nitro_pay/conversions_spec.rb
nitro_pay-1.0.4 spec/nitro_pay/conversions_spec.rb
nitro_pay-1.0.3 spec/nitro_pay/conversions_spec.rb
nitro_pay-1.0.2 spec/nitro_pay/conversions_spec.rb
nitro_pay-1.0.1 spec/nitro_pay/conversions_spec.rb
nitro_pay-1.0.0 spec/nitro_pay/conversions_spec.rb