Sha256: 464381ee06029843ecaf64b53f972f2deec28a7ed32dd0cc2927f86f07749146

Contents?: true

Size: 904 Bytes

Versions: 6

Compression:

Stored size: 904 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe SEPA::CreditorAccount do
  it 'should initialize a new account' do
    expect(
      SEPA::CreditorAccount.new name:                'Gläubiger GmbH',
                                bic:                 'BANKDEFFXXX',
                                iban:                'DE87200500001234567890',
                                creditor_identifier: 'DE98ZZZ09999999999'
    ).to be_valid
  end

  describe :creditor_identifier do
    it 'should accept valid value' do
      SEPA::CreditorAccount.should accept('DE98ZZZ09999999999', 'AT12ZZZ00000000001', 'IT97ZZZA1B2C3D4E5F6G7H8', 'NL97ZZZ123456780001', 'FR12ZZZ123456', for: :creditor_identifier)
    end

    it 'should not accept invalid value' do
      SEPA::CreditorAccount.should_not accept('', 'invalid', 'DE98ZZZ099999999990', 'DEAAAAAAAAAAAAAAAA', for: :creditor_identifier)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sepa_king-0.3.0 spec/creditor_account_spec.rb
sepa_king-0.2.0 spec/creditor_account_spec.rb
sepa_king-0.1.0 spec/creditor_account_spec.rb
sepa_king-0.0.7 spec/creditor_account_spec.rb
sepa_king-0.0.6 spec/creditor_account_spec.rb
sepa_king-0.0.5 spec/creditor_account_spec.rb