Sha256: 2dfadc0fa67fc8900e89fd7024f44d34a963847186bff93ec4a706eaf06b4d98
Contents?: true
Size: 825 Bytes
Versions: 109
Compression:
Stored size: 825 Bytes
Contents
require 'spec_helper' RSpec.describe RockRMS::Response::PaymentDetail, type: :model do let(:parsed) { JSON.parse(FixturesHelper.read('payment_details.json')) } describe '.format' do subject(:result) { described_class.format(parsed) } context 'when response is array' do it 'returns an array' do expect(described_class.format([])).to be_a(Array) end end it 'translates keys' do result.zip(parsed) do |r, p| expect(r[:id]).to eq(p['Id']) expect(r[:exp_month]).to eq(p['ExpirationMonth']) expect(r[:exp_year]).to eq(p['ExpirationYear']) expect(r[:foreign_key]).to eq(p['ForeignKey']) expect(r[:payment_type_id]).to eq(p['CurrencyTypeValueId']) expect(r[:masked_number]).to eq(p['AccountNumberMasked']) end end end end
Version data entries
109 entries across 109 versions & 1 rubygems