Skip to content

Commit

Permalink
Removed used of secondary_education_teaching_qualification_required?
Browse files Browse the repository at this point in the history
  • Loading branch information
syed87 committed Sep 25, 2023
1 parent 7eee234 commit 36064f8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 29 deletions.
5 changes: 0 additions & 5 deletions app/lib/country_code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ def european_economic_area?(code)
Country::CODES_IN_EUROPEAN_ECONOMIC_AREA.include?(code)
end

def secondary_education_teaching_qualification_required?(code)
country = Country.find_by(code:)
country&.subject_limited || false
end

LOCATIONS_BY_COUNTRY_CODE =
Country::LOCATION_AUTOCOMPLETE_CANONICAL_LIST
.map { |row| [CountryCode.from_location(row.last), row.last] }
Expand Down
2 changes: 1 addition & 1 deletion app/models/application_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def english_language_exempt?
end

def secondary_education_teaching_qualification_required?
country&.subject_limited || false
country.subject_limited
end

def created_under_new_regulations?
Expand Down
4 changes: 1 addition & 3 deletions app/models/eligibility_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ def status
def qualified_for_subject_required?
return false if country_code.blank?

CountryCode.secondary_education_teaching_qualification_required?(
country_code,
)
Country.exists?(code: country_code, subject_limited: true)
end

private
Expand Down
20 changes: 0 additions & 20 deletions spec/lib/country_code_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,4 @@

include_examples "true with codes", Country::CODES_IN_EUROPEAN_ECONOMIC_AREA
end

describe "#secondary_education_teaching_qualification_required?" do
subject(:secondary_education_teaching_qualification_required?) do
described_class.secondary_education_teaching_qualification_required?(
country.code,
)
end

context "when subject_limited is true" do
let(:country) { create(:country, :subject_limited, code: "AU") }

it { is_expected.to be true }
end

context "when subject_limited is false" do
let(:country) { create(:country, code: "AU", subject_limited: false) }

it { is_expected.to be false }
end
end
end

0 comments on commit 36064f8

Please sign in to comment.