Skip to content

Commit

Permalink
RST-5521 HMRC office check loads array (#1446)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaparka authored Jul 5, 2023
1 parent ed6f99e commit 67ce90c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/report/ocmc_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/application_checkable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion features/support/page_objects/sign_in_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/models/concerns/application_checkable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67ce90c

Please sign in to comment.