Sha256: 5f791d5834951dad809f1e2a717b3d591570b4db9b765d6b810ebf2bb7f81985

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

describe MangoPay::InstantConversion, type: :feature do
  include_context 'instant_conversion'

  describe 'GET CONVERSION RATE' do
    it 'get a conversion rate' do
      conversion_rate = get_conversion_rate('EUR','GBP')

      expect(conversion_rate['ClientRate']).not_to be_nil
      expect(conversion_rate['MarketRate']).not_to be_nil
    end
  end

  describe 'CREATE CONVERSION' do
    it 'creates a new conversion' do
      conversion = create_instant_conversion

      expect(conversion['DebitedFunds']['Amount']).not_to be_nil
      expect(conversion['CreditedFunds']['Amount']).not_to be_nil
      expect(conversion['Status']).equal? 'SUCCEEDED'
    end
  end

  describe 'GET EXISTING CONVERSION' do
    it 'get an existing conversion' do
      conversion = create_instant_conversion
      returned_conversion = get_instant_conversion(conversion['Id'])

      expect(returned_conversion['DebitedFunds']['Amount']).not_to be_nil
      expect(returned_conversion['CreditedFunds']['Amount']).not_to be_nil
      expect(returned_conversion['Status']).equal? 'SUCCEEDED'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mangopay-3.22.0 spec/mangopay/instant_conversion_spec.rb
mangopay-3.21.0 spec/mangopay/instant_conversion_spec.rb
mangopay-3.20.0 spec/mangopay/instant_conversion_spec.rb
mangopay-3.19.0 spec/mangopay/instant_conversion_spec.rb
mangopay-3.18.0 spec/mangopay/instant_conversion_spec.rb