From 8257a82f2f5d4b8c33e47bf430d9f08380cdb378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 29 Oct 2020 20:15:12 +0100 Subject: [PATCH] Use date objects when building office residences Since the interface to select this date uses the classic multi-field interface for day, month and year, we're transforming it into a date in the Office::Residence initializer. However, the factory to build an office residence does not assign the paremeters in the initializer but using the `date_of_birth=` method, so when doing so we need to use a date instead of a string. --- spec/models/officing/residence_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/officing/residence_spec.rb b/spec/models/officing/residence_spec.rb index 07304b69f..512d2a232 100644 --- a/spec/models/officing/residence_spec.rb +++ b/spec/models/officing/residence_spec.rb @@ -38,7 +38,7 @@ describe Officing::Residence do let(:custom_residence) do build(:officing_residence, document_number: "12345678Z", - date_of_birth: "01/01/1980", + date_of_birth: Date.parse("01/01/1980"), postal_code: "28001") end