Skip to content

Commit

Permalink
Remove qualification prior to work history banner
Browse files Browse the repository at this point in the history
We don't need to show this banner any more as there will be additional
banners added to the other pages to clarify this.

This reverts 27dfcb2.
  • Loading branch information
thomasleese committed Nov 22, 2023
1 parent 3a33ac4 commit adc5834
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 72 deletions.
12 changes: 0 additions & 12 deletions app/helpers/application_form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,4 @@ def application_form_summary_rows(
},
].compact
end

def application_form_display_work_history_before_teaching_qualification_banner?(
application_form
)
earliest_certificate_date =
application_form.teaching_qualification&.certificate_date
earliest_work_history_date =
application_form.work_histories.pluck(:start_date).compact.min

earliest_certificate_date.present? && earliest_work_history_date.present? &&
earliest_work_history_date < earliest_certificate_date
end
end
7 changes: 0 additions & 7 deletions app/views/teacher_interface/application_forms/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<% content_for :page_title, "Check your answers" %>
<% content_for :back_link_url, back_history_path(default: teacher_interface_application_form_path) %>

<% if application_form_display_work_history_before_teaching_qualification_banner?(@application_form) %>
<%= govuk_notification_banner(
title_text: "Important",
text: "You’ve added at least one teaching role that started before you were recognised as a qualified teacher. Any time spent in teaching roles that took place before you were recognised will not count towards your QTS application."
) %>
<% end %>

<h1 class="govuk-heading-xl">Check your answers before submitting your application</h1>

<section id="app-application-form-about-you">
Expand Down
53 changes: 0 additions & 53 deletions spec/helpers/application_form_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,57 +185,4 @@
end
end
end

describe "#application_form_display_work_history_before_teaching_qualification_banner?" do
subject do
application_form_display_work_history_before_teaching_qualification_banner?(
application_form,
)
end

context "when both dates are present and work history date is earlier" do
before do
create(
:qualification,
application_form:,
certificate_date: Date.new(2023, 1, 1),
)
application_form.work_histories.create!(
start_date: Date.new(2022, 1, 1),
)
end

it "returns true" do
expect(subject).to be true
end
end

context "when both dates are present and work history date is later" do
before do
create(
:qualification,
application_form:,
certificate_date: Date.new(2022, 1, 1),
)
application_form.work_histories.create!(
start_date: Date.new(2023, 1, 1),
)
end

it "returns false" do
expect(subject).to be false
end
end

context "when either date is missing" do
before do
create(:qualification, application_form:, certificate_date: nil)
application_form.work_histories.destroy_all
end

it "returns false" do
expect(subject).to be false
end
end
end
end

0 comments on commit adc5834

Please sign in to comment.