Sha256: b00ae6548c3a1f047cff8fd473a0c04f1b60a2f8615ace7d6448bac1e3bac68b

Contents?: true

Size: 1.27 KB

Versions: 22

Compression:

Stored size: 1.27 KB

Contents

require 'ifsc'
require 'bank'

describe Razorpay::IFSC::Bank do
  it 'should define the relevant constants' do
    expect(described_class::PUNB).to eq :PUNB
  end

  it 'should return details from the bank code' do
    expect(described_class.get_details(:PUNB)).to eq(code: 'PUNB',
                                                     type: 'PSB',
                                                     upi: true,
                                                     ifsc: 'PUNB0244200',
                                                     micr: '110024001',
                                                     bank_code: '024',
                                                     iin: '508568',
                                                     apbs: true,
                                                     ach_credit: true,
                                                     ach_debit: true,
                                                     nach_debit: true)
  end

  it 'should match all constants defined in PHP' do
  	constants_file = File.readlines('src/php/Bank.php')
	bank_constants = constants_file.select { |e| e.match(/const/) }.map { |e| e[/\s+const (\w{4})/, 1] }

  	bank_constants.each do |c|
  	  expect(described_class::const_get(c)).to eq c.to_sym
  	end
  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ifsc-2.0.6 tests/ruby/bank_spec.rb
ifsc-2.0.5 tests/ruby/bank_spec.rb
ifsc-2.0.4 tests/ruby/bank_spec.rb
ifsc-2.0.3 tests/ruby/bank_spec.rb
ifsc-2.0.2 tests/ruby/bank_spec.rb
ifsc-2.0.1 tests/ruby/bank_spec.rb
ifsc-2.0.0 tests/ruby/bank_spec.rb
ifsc-1.6.1 tests/ruby/bank_spec.rb
ifsc-1.6.0 tests/ruby/bank_spec.rb
ifsc-1.5.13 tests/ruby/bank_spec.rb
ifsc-1.5.12 tests/ruby/bank_spec.rb
ifsc-1.5.11 tests/ruby/bank_spec.rb
ifsc-1.5.10 tests/ruby/bank_spec.rb
ifsc-1.5.9 tests/ruby/bank_spec.rb
ifsc-1.5.8 tests/ruby/bank_spec.rb
ifsc-1.5.7 tests/ruby/bank_spec.rb
ifsc-1.5.6 tests/ruby/bank_spec.rb
ifsc-1.5.5 tests/ruby/bank_spec.rb
ifsc-1.5.3 tests/ruby/bank_spec.rb
ifsc-1.5.2 tests/ruby/bank_spec.rb