diff --git a/app/forms/idv/doc_pii_form.rb b/app/forms/idv/doc_pii_form.rb index 35e1a81d2a7..cda0eb71cf4 100644 --- a/app/forms/idv/doc_pii_form.rb +++ b/app/forms/idv/doc_pii_form.rb @@ -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 diff --git a/spec/controllers/idv/image_uploads_controller_spec.rb b/spec/controllers/idv/image_uploads_controller_spec.rb index d15775a0e07..804d48cc8ad 100644 --- a/spec/controllers/idv/image_uploads_controller_spec.rb +++ b/spec/controllers/idv/image_uploads_controller_spec.rb @@ -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,