Skip to content

Commit

Permalink
Merge pull request #1378 from DFE-Digital/add-redirect-for-all-paths
Browse files Browse the repository at this point in the history
Add all path redirect to GiT
  • Loading branch information
plisovin authored Aug 31, 2023
2 parents 2e8c135 + 5b85ce5 commit 81f4b8b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
end
end

get "/", 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 "/(*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 "/teacher_training_adviser/not_available", to: "teacher_training_adviser/steps#not_available"

Expand Down
24 changes: 24 additions & 0 deletions spec/requests/redirect_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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) do
["/teacher_training_adviser/sign_up/have_a_degree",
"/teacher_training_adviser/feedbacks/thank_you",
"/teacher_training_adviser/feedbacks/new",
"/teacher_training_adviser/sign_up"]
end

around do |example|
pages.each do |page|
@page = page
example.run
end
end

it "redirects to git url" do
get @page # rubocop:disable RSpec/InstanceVariable
expect(response.code).to eq("301")
expect(response.location).to eq(git_url)
end
end

0 comments on commit 81f4b8b

Please sign in to comment.