Skip to content

Commit

Permalink
Fix/ruby 3441 companies house gem (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulDoyle-EA authored Jan 9, 2025
1 parent e0f5ca9 commit 1c54e68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def company_status_invalid?

begin
company_status = DefraRuby::CompaniesHouse::API.run(company_number: company_no)[:company_status]
!%w[active voluntary-arrangement].include?(company_status)
!%i[active voluntary-arrangement].include?(company_status)
rescue StandardError => e
Rails.logger.error "Error checking company status: #{e}"
Airbrake.notify(e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@ module WasteCarriersEngine
let(:business_type) { nil }
let(:location) { "england" }
let(:companies_house_api) { instance_double(DefraRuby::CompaniesHouse::API) }
let(:companies_house_api_reponse) do
{
company_status:
}
end

let(:company_status) { "active" }
let(:companies_house_api_reponse) { { company_status: } }
let(:company_status) { :active }
let(:company_number) { "12345678" }

before do
Expand Down Expand Up @@ -76,8 +71,7 @@ module WasteCarriersEngine

shared_examples "check_registered_company_name_form or invalid_company_status_form" do

%w[active
voluntary-arrangement].each do |status|
%i[active voluntary-arrangement].each do |status|
context "with a company status of #{status}" do
let(:company_status) { status }

Expand Down

0 comments on commit 1c54e68

Please sign in to comment.