uppercases document number

This commit is contained in:
rgarcia
2015-09-05 23:04:13 +02:00
parent 17a1bedec0
commit 2260de9451
2 changed files with 8 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ class Verification::Residence
self.date_of_birth = parse_date('date_of_birth', attrs)
attrs = remove_date('date_of_birth', attrs)
super
self.document_number.upcase!
end
def save

View File

@@ -40,6 +40,13 @@ describe Verification::Residence do
end
end
describe "new" do
it "should upcase document number" do
residence = Verification::Residence.new({document_number: "x1234567z"})
expect(residence.document_number).to eq("X1234567Z")
end
end
describe "save" do
it "should store document number and type" do