Skip to content
13 changes: 4 additions & 9 deletions app/forms/idv/doc_pii_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,16 @@ class DocPiiForm
validates_presence_of :address1, { message: proc {
I18n.t('doc_auth.errors.alerts.address_check')
} }
validates_length_of :state, { is: 2,
message: proc {
I18n.t('doc_auth.errors.general.no_liveness')
} }
validates :zipcode, format: {
with: /\A[0-9]{5}(?:-[0-9]{4})?\z/,
message: proc {
I18n.t('doc_auth.errors.general.no_liveness')
},
}

validates :jurisdiction, inclusion: { in: Idp::Constants::STATE_AND_TERRITORY_CODES,
message: proc {
I18n.t('doc_auth.errors.general.no_liveness')
} }
validates :jurisdiction, :state, inclusion: { in: Idp::Constants::STATE_AND_TERRITORY_CODES,
message: proc {
I18n.t('doc_auth.errors.general.no_liveness')
} }

attr_reader :first_name, :last_name, :dob, :address1, :state, :zipcode, :attention_with_barcode,
:jurisdiction
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/image_uploads_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@
state: [I18n.t('doc_auth.errors.general.no_liveness')],
},
error_details: {
state: { wrong_length: true },
state: { inclusion: true },
},
attention_with_barcode: false,
user_id: user.uuid,
Expand Down