From 85612378b7ce8c1deac829f72586e96b938bee41 Mon Sep 17 00:00:00 2001 From: Pavel Lisovin Date: Tue, 29 Aug 2023 11:06:59 +0100 Subject: [PATCH 1/3] Add all path redirect to GiT --- .rspec | 1 + config/routes.rb | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.rspec b/.rspec index c99d2e739..3cb0ed2f6 100644 --- a/.rspec +++ b/.rspec @@ -1 +1,2 @@ --require spec_helper +--exclude-pattern "./spec/**/*_spec.rb" diff --git a/config/routes.rb b/config/routes.rb index e423eff97..8fd3fc859 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,9 +5,7 @@ end end - root "pages#home" - - get "/teacher_training_adviser/not_available", to: "teacher_training_adviser/steps#not_available" + get "/(*path)", to: redirect(host: "getintoteaching.education.gov.uk", path: "/teacher-training-adviser/sign_up/identity?utm_source=adviser-getintoteaching.education.gov.uk&utm_medium=referral&utm_campaign=adviser_redirect") get "/404", to: "errors#not_found", via: :all get "/403", to: "errors#forbidden", via: :all From fc619dbd49258fbcb03e60b3a186be45b74ffe2b Mon Sep 17 00:00:00 2001 From: Pavel Lisovin Date: Tue, 29 Aug 2023 11:41:12 +0100 Subject: [PATCH 2/3] Remove healtcheck --- .github/workflows/actions/deploy/action.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yml b/.github/workflows/actions/deploy/action.yml index 4b67eaf05..27188afbd 100644 --- a/.github/workflows/actions/deploy/action.yml +++ b/.github/workflows/actions/deploy/action.yml @@ -115,12 +115,6 @@ runs: TF_VAR_paas_adviser_docker_image: ${{ steps.variables.outputs.docker_image}} TF_VAR_AZURE_CREDENTIALS: ${{ inputs.AZURE_CREDENTIALS }} - - - name: Smoke tests - shell: bash - run: | - tests/confidence/healthcheck.sh "${{steps.variables.outputs.healthcheck}}" "${{ steps.sha.outputs.short }}" - - name: Log Deployment if: always() uses: DFE-Digital/github-actions/SendToLogit@master From ee0c60840451442481a6be9607b6a1820bb8288c Mon Sep 17 00:00:00 2001 From: Pavel Lisovin Date: Wed, 30 Aug 2023 11:38:53 +0100 Subject: [PATCH 3/3] Add redirect rspec test --- spec/requests/redirect_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/requests/redirect_spec.rb diff --git a/spec/requests/redirect_spec.rb b/spec/requests/redirect_spec.rb new file mode 100644 index 000000000..52f6417fc --- /dev/null +++ b/spec/requests/redirect_spec.rb @@ -0,0 +1,25 @@ +require "rails_helper" + +RSpec.describe "Redirects from any path", type: :request do + + let(:git_url) { "http://getintoteaching.education.gov.uk/teacher-training-adviser/sign_up/identity?utm_source=adviser-getintoteaching.education.gov.uk&utm_medium=referral&utm_campaign=adviser_redirect"} + let(:pages) { + ['/teacher_training_adviser/sign_up/have_a_degree', + '/teacher_training_adviser/feedbacks/thank_you', + '/teacher_training_adviser/feedbacks/new', + '/teacher_training_adviser/sign_up'] + } + + around do |example| + pages.each do |page| + @page = page + example.run + end + end + + it "redirects to git url" do + get @page + expect(response.code).to eq('301') + expect(response.location).to eq(git_url) + end +end