Sha256: 78b8c245934209bcea47cac4c8a720b9388d9e605989d6b106e8bbc54eb39e64

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe SEPA::Account do
  describe :new do
    it 'should not accept unknown keys' do
      expect {
        SEPA::Account.new foo: 'bar'
      }.to raise_error(NoMethodError)
    end
  end

  describe :name do
    it 'should accept valid value' do
      SEPA::Account.should accept('Gläubiger GmbH', 'Zahlemann & Söhne GbR', 'X' * 70, for: :name)
    end

    it 'should not accept invalid value' do
      SEPA::Account.should_not accept(nil, '', 'X' * 71, for: :name)
    end
  end

  describe :iban do
    it 'should accept valid value' do
      SEPA::Account.should accept('DE21500500009876543210', 'PL61109010140000071219812874', for: :iban)
    end

    it 'should not accept invalid value' do
      SEPA::Account.should_not accept(nil, '', 'invalid', for: :iban)
    end
  end

  describe :bic do
    it 'should accept valid value' do
      SEPA::Account.should accept('DEUTDEFF', 'DEUTDEFF500', 'SPUEDE2UXXX', for: :bic)
    end

    it 'should not accept invalid value' do
      SEPA::Account.should_not accept(nil, '', 'invalid', for: :bic)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sepa_king-0.0.7 spec/account_spec.rb
sepa_king-0.0.6 spec/account_spec.rb
sepa_king-0.0.5 spec/account_spec.rb