diff --git a/app/controllers/report/ocmc_controller.rb b/app/controllers/report/ocmc_controller.rb index dd535d623..c67b33e1e 100644 --- a/app/controllers/report/ocmc_controller.rb +++ b/app/controllers/report/ocmc_controller.rb @@ -36,7 +36,7 @@ def court_id end def ocmcc_court? - Office.find(court_id).entity_code == Settings.evidence_check.hmrc.office_entity_code + Settings.evidence_check.hmrc.office_entity_code.include?(Office.find(court_id).entity_code) end def export_file_prefix diff --git a/app/models/concerns/application_checkable.rb b/app/models/concerns/application_checkable.rb index 1a0615218..9d0af4590 100644 --- a/app/models/concerns/application_checkable.rb +++ b/app/models/concerns/application_checkable.rb @@ -17,7 +17,7 @@ def hmrc_check_type? private def hmrc_office_match? - office.try(:entity_code) == Settings.evidence_check.hmrc.office_entity_code + Settings.evidence_check.hmrc.office_entity_code.include?(office.try(:entity_code)) end end diff --git a/config/settings.yml b/config/settings.yml index 360f1cb5c..f413ea6e9 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -10,7 +10,7 @@ mail: evidence_check: expires_in_days: 14 hmrc: - office_entity_code: <%= ENV['HMRC_OFFICE_CODE'] || 'dig' %> + office_entity_code: <%= ENV['HMRC_OFFICE_CODE'].try(:split) || ['dig'] %> part_payment: expires_in_days: 14 submission: diff --git a/features/support/page_objects/sign_in_page.rb b/features/support/page_objects/sign_in_page.rb index 6ed717262..8303a9ebb 100644 --- a/features/support/page_objects/sign_in_page.rb +++ b/features/support/page_objects/sign_in_page.rb @@ -68,7 +68,7 @@ def user_account end def hmrc_user_account - office = FactoryBot.create(:office, entity_code: Settings.evidence_check.hmrc.office_entity_code) + office = FactoryBot.create(:office, entity_code: Settings.evidence_check.hmrc.office_entity_code.first) user = FactoryBot.create(:user, office: office) sign_in_with user user diff --git a/spec/models/concerns/application_checkable_spec.rb b/spec/models/concerns/application_checkable_spec.rb index 39d7d582f..e6577944e 100644 --- a/spec/models/concerns/application_checkable_spec.rb +++ b/spec/models/concerns/application_checkable_spec.rb @@ -103,7 +103,7 @@ let(:medium) { 'digital' } before do - Settings.evidence_check.hmrc.office_entity_code = 'dig' + Settings.evidence_check.hmrc.office_entity_code = ['dig'] end context 'single applicant' do