Sha256: 08ba1207a352447641806a6054d413811e8c88d0013c2c82aaf9ccf1ec4dd5f8
Contents?: true
Size: 1.14 KB
Versions: 1
Compression:
Stored size: 1.14 KB
Contents
require 'spec_helper' describe 'Rates', :vcr => true do before do CurrencyCloud.reset_session CurrencyCloud.environment = :demonstration CurrencyCloud.token = '242993ca94b9d1c6c1d8f7d3275a6f36' end it 'can #find' do rates = CurrencyCloud::Rate.find(currency_pair: 'GBPUSD,EURGBP') expect(rates).to_not be_nil expect(rates.currencies).to_not be_empty currencies = rates.currencies expect(currencies.length).to eq(2) currencies.each do |b| expect(b).to_not be_nil expect(b).to be_a_kind_of(CurrencyCloud::Rate) end rate = currencies.first expect(rate.currency_pair).to eq('EURGBP') expect(rate.bid).to eq('0.71445') expect(rate.offer).to eq('0.71508') expect(rates.unavailable).to be_empty end it 'can provided #detailed rate' do detailed_rate = CurrencyCloud::Rate.detailed(buy_currency: 'GBP', sell_currency: 'USD', fixed_side: 'buy', amount: '10000') expect(detailed_rate).to be_a_kind_of(CurrencyCloud::Rate) expect(detailed_rate.client_sell_amount).to eq('15234.00') expect(detailed_rate.settlement_cut_off_time).to eq('2015-04-29T14:00:00Z') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
currency_cloud-0.5 | spec/integration/rates_spec.rb |