Skip to content

Commit

Permalink
Fixed tests for random generations, since it cannot generate IBAN for…
Browse files Browse the repository at this point in the history
… countries where iban check digits are fixed.
  • Loading branch information
leio10 committed Oct 5, 2017
1 parent d7a8647 commit 0b548c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ validates :iban, iban: { tags: [:sepa] }
=> "IL317532867920826062774"
```

Note: It can't generate a valid IBAN code for some countries where iban check digits are fixed if validation code for that country is not available.

## Installation

1. Add this line to your application's Gemfile
Expand Down
4 changes: 2 additions & 2 deletions spec/iban_bic/random_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
end

context "when not_tags are given" do
let(:params) { { not_tags: [:sepa] } }
let(:params) { { not_tags: [:fixed_iban_check] } }

it "returns a valid IBAN" do
expect(IbanBic.valid?(subject)).to be_truthy
end

it "returns a valid IBAN from a country without that tags" do
expect(IbanBic.has_tags?(subject, [:sepa])).to be_falsey
expect(IbanBic.has_tags?(subject, [:fixed_iban_check])).to be_falsey
end
end
end
Expand Down

0 comments on commit 0b548c1

Please sign in to comment.