Sha256: 3cde38651ec677beb6004f44d4227e4c577110a4a21344ba20010e1d5598f6ac

Contents?: true

Size: 1.09 KB

Versions: 20

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe Ibandit::PseudoIBANAssembler do
  subject(:pseudo_iban) { described_class.new(local_details).assemble }

  context 'for Sweden' do
    context 'with valid parameters' do
      let(:local_details) do
        {
          country_code: 'SE',
          branch_code: '1281',
          account_number: '0105723'
        }
      end

      it { is_expected.to eq('SEZZX1281XXX0105723') }
    end

    context 'without a branch code' do
      let(:local_details) do
        {
          country_code: 'SE',
          account_number: '0105723'
        }
      end

      it { is_expected.to be_nil }
    end

    context 'without an account number' do
      let(:local_details) do
        {
          country_code: 'SE',
          branch_code: '1281'
        }
      end

      it { is_expected.to be_nil }
    end
  end

  context 'for a country that does not have pseudo-IBANs' do
    let(:local_details) do
      {
        country_code: 'GB',
        bank_code: 'WEST',
        branch_code: '123456',
        account_number: '98765432'
      }
    end

    it { is_expected.to be_nil }
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ibandit-0.11.6 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.11.5 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.11.4 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.11.3 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.11.2 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.11.1 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.11.0 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.10.1 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.10.0 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.9.1 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.9.0 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.8.8 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.8.7 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.8.6 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.8.5 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.8.4 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.8.3 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.8.2 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.8.1 spec/ibandit/pseudo_iban_assembler_spec.rb
ibandit-0.8.0 spec/ibandit/pseudo_iban_assembler_spec.rb