Return no variants when document_number is blank
Otherwise the variants returned for document_type="1" and document_number="" will be `["0", "00", "000", "0000", "00000", "000000", "0000000", "00000000"]` which seems to be useless.
This commit is contained in:
committed by
Javi Martín
parent
93e458d46e
commit
3ed4bdaff8
@@ -3,6 +3,10 @@ include DocumentParser
|
||||
|
||||
describe DocumentParser do
|
||||
describe "#get_document_number_variants" do
|
||||
it "returns no variants when document_number is not defined" do
|
||||
expect(DocumentParser.get_document_number_variants("1", "")).to be_empty
|
||||
end
|
||||
|
||||
it "trims and cleans up entry" do
|
||||
expect(DocumentParser.get_document_number_variants(2, " 1 2@ 34")).to eq(["1234"])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user