diff --git a/lib/ibandit/german_details_converter.rb b/lib/ibandit/german_details_converter.rb index fbebe9a..75104a9 100644 --- a/lib/ibandit/german_details_converter.rb +++ b/lib/ibandit/german_details_converter.rb @@ -270,13 +270,15 @@ def padded_account_number_for_validity when "13" if unpadded_account_number.size.between?(6, 7) unpadded_account_number + "00" - else @account_number + else + @account_number end when "76" case unpadded_account_number.size when 7..8 if Check76.new(@account_number).valid? then @account_number - else unpadded_account_number + "00" + else + unpadded_account_number + "00" end when 5..6 then unpadded_account_number + "00" else @account_number diff --git a/lib/ibandit/local_details_cleaner.rb b/lib/ibandit/local_details_cleaner.rb index 435c5c0..2da1ae0 100644 --- a/lib/ibandit/local_details_cleaner.rb +++ b/lib/ibandit/local_details_cleaner.rb @@ -42,7 +42,8 @@ def self.required_fields(country_code) %i[account_number] when "GB", "IE", "MT" if Ibandit.bic_finder.nil? then %i[bank_code branch_code account_number] - else %i[branch_code account_number] + else + %i[branch_code account_number] end when "AU" %i[branch_code account_number] diff --git a/spec/ibandit/german_details_converter_spec.rb b/spec/ibandit/german_details_converter_spec.rb index 977461e..9e98679 100644 --- a/spec/ibandit/german_details_converter_spec.rb +++ b/spec/ibandit/german_details_converter_spec.rb @@ -19,7 +19,7 @@ convertor.fetch("valid", []).each do |tuple| context "bank code: #{tuple['bank_code']} account number " \ - "#{tuple['account_number']}" do + "#{tuple['account_number']}" do let(:bank_code) do tuple["bank_code"] end @@ -44,7 +44,7 @@ convertor.fetch("invalid", []).each do |tuple| context "bank code: #{tuple['bank_code']} account number " \ - "#{tuple['account_number']}" do + "#{tuple['account_number']}" do let(:bank_code) { tuple["bank_code"] || "00000000" } let(:account_number) { tuple["account_number"] } diff --git a/spec/ibandit/iban_spec.rb b/spec/ibandit/iban_spec.rb index 3e3e11e..8e677d8 100755 --- a/spec/ibandit/iban_spec.rb +++ b/spec/ibandit/iban_spec.rb @@ -1061,7 +1061,7 @@ iban.valid_length? expect(iban.errors). to include(length: "Length doesn't match SWIFT specification " \ - "(expected 22 characters, received 20)") + "(expected 22 characters, received 20)") end end @@ -1313,7 +1313,7 @@ iban.valid_branch_code_length? expect(iban.errors). to include(branch_code: "is the wrong length (should be 6 " \ - "characters)") + "characters)") end end