Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references to 'other_secondary' qualifications #7440

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ def category_form_class(category)
name = case category
when "gcse", "a_level", "as_level"
"Secondary::CommonForm"
when "other_secondary"
"Secondary::OtherForm"
when "undergraduate", "postgraduate"
"DegreeForm"
when "other"
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion app/helpers/qualifications_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module QualificationsHelper
a_level
as_level
gcse
other_secondary
other
].freeze

Expand Down
6 changes: 3 additions & 3 deletions app/models/qualification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class Qualification < ApplicationRecord
accepts_nested_attributes_for :qualification_results
has_encrypted :finished_studying_details

SECONDARY_QUALIFICATIONS = %w[gcse as_level a_level other_secondary].freeze
SECONDARY_QUALIFICATIONS = %w[gcse as_level a_level].freeze

enum :category, { gcse: 0, as_level: 1, a_level: 2, other_secondary: 3, undergraduate: 4, postgraduate: 5, other: 6 }
enum :category, { gcse: 0, as_level: 1, a_level: 2, undergraduate: 4, postgraduate: 5, other: 6 }

before_validation :remove_inapplicable_data, :mark_emptied_qualification_results_for_destruction

Expand All @@ -29,7 +29,7 @@ def duplicate
end

def name
return read_attribute(:name) if read_attribute(:name).present? || other? || other_secondary?
return read_attribute(:name) if read_attribute(:name).present? || other?

I18n.t("helpers.label.jobseekers_qualifications_category_form.category_options.#{category}")
end
Expand Down
19 changes: 0 additions & 19 deletions app/services/qualifications_migration.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/jobseekers/qualifications/_fields.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= f.hidden_field :category

- case category
- when "gcse", "as_level", "a_level", "other_secondary"
- when "gcse", "as_level", "a_level"
= render "jobseekers/qualifications/fields/secondary_school", f: f, category: category
- when "undergraduate", "postgraduate", "degree"
= render "jobseekers/qualifications/fields/degree", f: f
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
= f.govuk_text_field :institution, label: { size: "s" }, aria: { required: true }, width: "three-quarters"

- if category == "other_secondary"
= f.govuk_text_field :name, label: { size: "s" }, aria: { required: true }, width: "two-thirds"

= f.govuk_number_field :year, label: { size: "s" }, aria: { required: true }, width: 4

= f.govuk_fieldset legend: { text: t("helpers.legend.jobseekers_qualifications_shared_legends.subjects") }, class: "subjects-and-grades", data: { controller: "manage-qualifications" } do
Expand Down
6 changes: 0 additions & 6 deletions config/locales/forms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ en:
gcse: GCSEs
as_level: AS Levels
a_level: A Levels
other_secondary: Other secondary qualification
undergraduate: Undergraduate degree
postgraduate: Postgraduate qualification
other: Other qualification
Expand Down Expand Up @@ -453,7 +452,6 @@ en:
gcse: GCSEs
as_level: AS Levels
a_level: A Levels
other_secondary: Other secondary qualification
undergraduate: Undergraduate degree
postgraduate: Postgraduate qualification
other: Other qualification
Expand All @@ -471,10 +469,6 @@ en:
jobseekers_qualifications_secondary_common_form:
<<: *jobseekers_qualifications_shared_labels
institution: School, college, or other organisation
jobseekers_qualifications_secondary_other_form:
<<: *jobseekers_qualifications_shared_labels
institution: School, college, or other organisation
name: Qualification name
jobseekers_profile_qualified_teacher_status_form:
qualified_teacher_status_options:
"yes": "Yes"
Expand Down
3 changes: 0 additions & 3 deletions config/locales/jobseekers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ en:
gcse: Edit GCSEs
as_level: Edit AS Levels
a_level: Edit A Levels
other_secondary: Edit secondary qualifications
undergraduate: Edit undergraduate degree
postgraduate: Edit postgraduate qualification
other: Edit qualification
Expand All @@ -421,7 +420,6 @@ en:
gcse: Add GCSEs
as_level: Add AS Levels
a_level: Add A Levels
other_secondary: Add secondary qualifications
undergraduate: Add an undergraduate degree
postgraduate: Add a postgraduate qualification
other: Add a qualification
Expand Down Expand Up @@ -811,7 +809,6 @@ en:
gcse: Add GCSEs
as_level: Add AS Levels
a_level: Add A Levels
other_secondary: Add secondary qualifications
undergraduate: Add an undergraduate degree
postgraduate: Add a postgraduate qualification
other: Add a qualification
Expand Down
9 changes: 0 additions & 9 deletions lib/tasks/update_other_secondary_qualifications.rake

This file was deleted.

2 changes: 1 addition & 1 deletion spec/factories/qualifications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
end
end
institution { secondary? ? Faker::Educator.secondary_school : Faker::Educator.university }
name { other_secondary? || other? ? Faker::Educator.degree : "" }
name { other? ? Faker::Educator.degree : "" }
subject { undergraduate? || postgraduate? || other? ? Faker::Educator.subject : "" }
year { finished_studying == false ? nil : factory_rand(1970..2020) }

Expand Down

This file was deleted.

6 changes: 3 additions & 3 deletions spec/models/qualification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
describe "#name" do
let(:qualification) { build_stubbed(:qualification, name: name, category: category) }

context "when the category is 'other_secondary' or 'other'" do
let(:category) { "other_secondary" }
context "when the category is 'other'" do
let(:category) { "other" }
let(:name) { "Welsh Baccalaureate" }

context "when the name has been set" do
Expand All @@ -26,7 +26,7 @@
end
end

context "when the category is not 'other_secondary' or 'other' and the name has not been set" do
context "when the category is not 'other' and the name has not been set" do
let(:category) { "undergraduate" }
let(:name) { "" }

Expand Down
82 changes: 0 additions & 82 deletions spec/services/qualifications_migration_spec.rb

This file was deleted.

10 changes: 0 additions & 10 deletions spec/support/jobseeker_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,6 @@ def fill_in_gcses
fill_in I18n.t("helpers.label.jobseekers_qualifications_shared_labels.year"), with: "2020"
end

def fill_in_custom_secondary_qualifications
fill_in "Qualification name", with: "Welsh Baccalaureate"
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][0][subject]", with: "Science"
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][0][grade]", with: "5"
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][1][subject]", with: "German"
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][1][grade]", with: "4"
fill_in "School, college, or other organisation", with: "Happy Rainbows School for High Achievers"
fill_in I18n.t("helpers.label.jobseekers_qualifications_shared_labels.year"), with: "2020"
end

def fill_in_undergraduate_degree
fill_in "Subject", with: "Linguistics"
fill_in "Awarding body", with: "University of Life"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@
context "when the qualification has qualification results" do
let!(:qualification) do
create(:qualification,
category: "other_secondary",
category: "a_level",
institution: "John Mason School",
job_application: job_application)
end

it "allows jobseekers to edit the qualification and its results" do
visit jobseekers_job_application_build_path(job_application, :qualifications)
click_on I18n.t("buttons.change")
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][0][subject]", with: "Hard Knocks"
fill_in "jobseekers_qualifications_secondary_common_form[qualification_results_attributes][0][subject]", with: "Hard Knocks"
empty_second_qualification_result
fill_in "School", with: "St Nicholas School"
expect { click_on I18n.t("buttons.save_qualification.one") }.to change { qualification.qualification_results.count }.by(-1)
Expand Down Expand Up @@ -114,7 +114,7 @@
end

def empty_second_qualification_result
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][1][subject]", with: ""
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][1][grade]", with: ""
fill_in "jobseekers_qualifications_secondary_common_form[qualification_results_attributes][1][subject]", with: ""
fill_in "jobseekers_qualifications_secondary_common_form[qualification_results_attributes][1][grade]", with: ""
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@
context "when the qualification has qualification results" do
let!(:qualification) do
create(:qualification,
category: "other_secondary",
category: "a_level",
institution: "John Mason School",
jobseeker_profile_id: profile.id)
end

it "allows jobseekers to edit the qualification and its results" do
visit review_jobseekers_profile_qualifications_path
click_on "Change"
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][0][subject]", with: "Hard Knocks"
fill_in "jobseekers_qualifications_secondary_common_form[qualification_results_attributes][0][subject]", with: "Hard Knocks"
empty_second_qualification_result
fill_in "School", with: "St Nicholas School"
click_on I18n.t("buttons.save_and_continue")
Expand Down Expand Up @@ -136,7 +136,7 @@
end

def empty_second_qualification_result
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][1][subject]", with: ""
fill_in "jobseekers_qualifications_secondary_other_form[qualification_results_attributes][1][grade]", with: ""
fill_in "jobseekers_qualifications_secondary_common_form[qualification_results_attributes][1][subject]", with: ""
fill_in "jobseekers_qualifications_secondary_common_form[qualification_results_attributes][1][grade]", with: ""
end
end
Loading