diff --git a/config/routes.rb b/config/routes.rb
index 7aaa74fd0a..59f7a00d71 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -16,8 +16,6 @@
# setup a simple healthcheck endpoint for monitoring purposes
get "/healthcheck", to: proc { [200, {}, ["OK"]] }
- get "refresh-session", to: "sessions#refresh", as: :refresh_session
-
# Used to constrain claim journey routing so only slugs
# that are part of a journey's slug sequence are routed.
restrict_to_sequence_slugs = Class.new {
@@ -47,7 +45,6 @@ def matches?(request)
post "claim", as: :claims, to: "claims#create"
post "claim/submit", as: :claim_submission, to: "submissions#create"
get "claims/confirmation", as: :claim_confirmation, to: "submissions#show"
- get "timeout", to: "claims#timeout", as: :timeout_claim
get "existing-session", as: :existing_session, to: "claims#existing_session"
post "start-new", to: "claims#start_new", as: :start_new
diff --git a/spec/features/changing_answers_spec.rb b/spec/features/changing_answers_spec.rb
index 0ad5cd1dd2..1ffc88ba46 100644
--- a/spec/features/changing_answers_spec.rb
+++ b/spec/features/changing_answers_spec.rb
@@ -64,7 +64,6 @@
expect(find("#claim_qts_award_year_on_or_after_cut_off_date").checked?).to eq(true)
choose_qts_year :before_cut_off_date
- click_on "Continue"
expect(session.reload.answers.qts_award_year).to eq("before_cut_off_date")
diff --git a/spec/features/timeout_spec.rb b/spec/features/timeout_spec.rb
deleted file mode 100644
index ed8ef80c62..0000000000
--- a/spec/features/timeout_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require "rails_helper"
-
-RSpec.feature "Teacher Student Loan Repayments claims", js: true do
- let(:one_second_in_minutes) { 1 / 60.to_f }
- let(:two_seconds_in_minutes) { 2 / 60.to_f }
-
- before do
- create(:journey_configuration, :student_loans)
- allow_any_instance_of(BasePublicController).to receive(:claim_timeout_in_minutes) { two_seconds_in_minutes }
- allow_any_instance_of(BasePublicController).to receive(:timeout_warning_in_minutes) { one_second_in_minutes }
- start_student_loans_claim
- end
-
- scenario "Dialog warns claimants their session will timeout" do
- expect(page).to have_content("Your session will expire in #{one_second_in_minutes} minutes")
- expect(page).to have_button("Continue session")
- end
-
- scenario "Claimants can refresh their session" do
- expect(page).to have_content("Your session will expire in #{one_second_in_minutes} minutes")
- expect_any_instance_of(SessionsController).to receive(:update_last_seen_at)
- click_on "Continue session"
- expect(current_path).to eql(claim_path(Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME, "claim-school"))
- expect(page).not_to have_content("Your session will expire in #{one_second_in_minutes} minutes")
- end
-
- scenario "Claimants are automatically redirected to the timeout page" do
- wait_until_visible { find("h1", text: "Your session has ended due to inactivity") }
- expect(current_path).to eql(timeout_claim_path(Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME))
- end
-end
diff --git a/spec/requests/claims_spec.rb b/spec/requests/claims_spec.rb
index 66ca9ca30a..4cd547c865 100644
--- a/spec/requests/claims_spec.rb
+++ b/spec/requests/claims_spec.rb
@@ -159,15 +159,6 @@ def check_slug_redirection
end
end
- describe "claims#timeout" do
- before { create(:journey_configuration, :student_loans) }
-
- it "displays session timeout content" do
- get timeout_claim_path(Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME)
- expect(response.body).to include("Your session has ended due to inactivity")
- end
- end
-
describe "claims#update request" do
before { create(:journey_configuration, :student_loans) }
diff --git a/spec/requests/sessions_spec.rb b/spec/requests/sessions_spec.rb
deleted file mode 100644
index 551e22992e..0000000000
--- a/spec/requests/sessions_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require "rails_helper"
-
-RSpec.describe "Sessions", type: :request do
- before { create(:journey_configuration, :student_loans) }
-
- describe "#refresh" do
- it "updates the last_seen_at session timestamp and responds with OK" do
- start_student_loans_claim
-
- travel_to(1.day.from_now) do
- get refresh_session_path
-
- expect(session[:last_seen_at]).to eql(Time.zone.now)
- expect(response).to have_http_status(:ok)
- end
- end
-
- it "does not extend an expired public user session" do
- start_student_loans_claim
-
- travel(2.hours) do
- get refresh_session_path
- expect(session[:claim_id]).to be_nil
-
- get claim_path(Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME, "qts-year")
- expect(response).to redirect_to(Journeys::TeacherStudentLoanReimbursement.start_page_url)
- end
- end
- end
-end
diff --git a/spec/requests/submissions_spec.rb b/spec/requests/submissions_spec.rb
index 5c3fd215a3..f6a52124b8 100644
--- a/spec/requests/submissions_spec.rb
+++ b/spec/requests/submissions_spec.rb
@@ -39,7 +39,6 @@
expect(email[:personalisation].decoded).to include("ref_number")
expect(email[:personalisation].decoded).to include(submitted_claim.reference)
- expect(session[:claim_id]).to be_nil
expect(session[:slugs]).to be_nil
expect(session[:submitted_claim_id]).to eq(submitted_claim.id)
end
diff --git a/spec/requests/timeout_spec.rb b/spec/requests/timeout_spec.rb
deleted file mode 100644
index 1795ba14b6..0000000000
--- a/spec/requests/timeout_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require "rails_helper"
-
-RSpec.describe "Claim session timing out", type: :request do
- let(:timeout_length_in_minutes) { BasePublicController::CLAIM_TIMEOUT_LENGTH_IN_MINUTES }
- let(:journey_session) do
- Journeys::TeacherStudentLoanReimbursement::Session.last
- end
-
- before { create(:journey_configuration, :student_loans) }
-
- context "no actions performed for more than the timeout period" do
- before do
- start_student_loans_claim
- end
-
- let(:after_expiry) { timeout_length_in_minutes.minutes + 1.second }
-
- it "clears the session and redirects to the timeout page" do
- expect(
- session[:"student-loans_journeys_session_id"]
- ).to eq journey_session.id
-
- travel after_expiry do
- put claim_path(Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME, "qts-year"), params: {claim: {qts_award_year: "on_or_after_cut_off_date"}}
-
- expect(response).to redirect_to(timeout_claim_path)
- expect(session[:claim_id]).to be_nil
- end
- end
- end
-
- context "no action performed just within the timeout period" do
- before do
- start_student_loans_claim
- set_slug_sequence_in_session(journey_session, "qts-year")
- end
-
- let(:before_expiry) { timeout_length_in_minutes.minutes - 2.seconds }
-
- it "does not timeout the session" do
- travel before_expiry do
- put claim_path(Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME, "qts-year"), params: {claim: {qts_award_year: "on_or_after_cut_off_date"}}
-
- expect(response).to redirect_to(claim_path(Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME, "claim-school"))
- end
- end
- end
-end