require File.join(Dir.pwd, 'spec', 'spec_helper') describe 'Experian::DataDictionary 0100' do context 'valid lookup' do it { expect(Experian::DataDictionary.column_name('0100')).to eq('Date of Birth') } it { expect(Experian::DataDictionary.lookup('0100', '198412')).to eq('12/1984') } it { expect(Experian::DataDictionary.lookup('0100', '19931')).to eq('1/1993') } it { expect(Experian::DataDictionary.lookup('0100', '19684')).to eq('4/1968') } end context 'invalid lookup' do it { expect(Experian::DataDictionary.lookup('0100', '0')).to eq('0') } end end describe 'Experian::DataDictionary 0100c' do context 'valid lookup' do it { expect(Experian::DataDictionary.column_name('0100c')).to eq('Combined Adult Age') } it { expect(Experian::DataDictionary.lookup('0100c', 'e99')).to eq('99 - Exact age') } it { expect(Experian::DataDictionary.lookup('0100c', 'i50')).to eq('50 - Estimated age') } it { expect(Experian::DataDictionary.lookup('0100c', 'u')).to eq(' - Unknown age') } it { expect(Experian::DataDictionary.lookup('0100c', '')).to eq('Unknown age') } end context 'invalid lookup' do it { expect(Experian::DataDictionary.lookup('0100c', 'D')).to be_nil } it { expect(Experian::DataDictionary.lookup('0100c', 'GG')).to be_nil } it { expect(Experian::DataDictionary.lookup('0100c', 'DOG')).to be_nil } end end