diff --git a/app/models/person.rb b/app/models/person.rb index 02bdf96..b232d02 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -122,7 +122,7 @@ class Person < Profile validates_each :birth_date do |record,attr,value| if value && value.year == 1 - record.errors.add(attr, _('%{fn} is invalid')) + record.errors.add(attr) end end @@ -135,7 +135,7 @@ class Person < Profile self.required_fields.each do |field| if self.send(field).blank? unless (field == 'custom_area_of_study' && self.area_of_study != 'Others') || (field == 'custom_formation' && self.formation != 'Others') - self.errors.add(field, _('%{fn} is mandatory')) + self.errors.add_on_blank(field) end end end diff --git a/features/edit_profile.feature b/features/edit_profile.feature index e83e925..32b2cb8 100644 --- a/features/edit_profile.feature +++ b/features/edit_profile.feature @@ -16,7 +16,7 @@ Feature: edit profile And I select "15" And I press "Save" Then I should see "Birth date is invalid" - And I should not see "Birth date is mandatory" + And I should not see "Birth date can't be blank" Scenario: Warn about invalid birth date when required Given the following person fields are required fields @@ -28,7 +28,7 @@ Feature: edit profile And I select "15" And I press "Save" Then I should see "Birth date is invalid" - And I should see "Birth date is mandatory" + And I should not see "Birth date can't be blank" Scenario: Not warn if birth date is valid when active Given the following person fields are active fields -- libgit2 0.21.2