Skip to content

Commit

Permalink
redirect closed service offsite
Browse files Browse the repository at this point in the history
  • Loading branch information
asmega committed Sep 25, 2024
1 parent 23cf55c commit 10ddcb1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ def check_service_open!
return if request.path == destroy_user_session_path # skip this for log out page
return if Gatekeeper.application_open?

redirect_to("https://getintoteaching.education.gov.uk/non-uk-teachers/get-an-international-relocation-payment")
redirect_to(
"https://getintoteaching.education.gov.uk/non-uk-teachers/get-an-international-relocation-payment",
allow_other_host: true,
)
end

def current_form
Expand Down
6 changes: 3 additions & 3 deletions spec/features/admin_console/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
it "does allow access to non-admin if Service is closed" do
given_the_service_is_closed
visit root_path
then_i_should_see_the_service_closed_page
then_i_should_see_offsite_guidance_page
end

private
Expand All @@ -31,8 +31,8 @@ def given_the_service_is_closed
AppSettings.current.update!(service_start_date: 2.days.from_now)
end

def then_i_should_see_the_service_closed_page
expect(page).to have_current_path("/closed")
def then_i_should_see_offsite_guidance_page
expect(page.current_url).to eql("https://getintoteaching.education.gov.uk/non-uk-teachers/get-an-international-relocation-payment")
end

def when_i_visit_the_settings_page
Expand Down
5 changes: 3 additions & 2 deletions spec/features/open_close_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
it "does not allow the user access to the landing page" do
visit root_path

expect(page).to have_current_path("/closed")
expect(page.current_url).to eql("https://getintoteaching.education.gov.uk/non-uk-teachers/get-an-international-relocation-payment")
end

it "allows the user access to the admin tool" do
xit "allows the user access to the admin tool" do
given_i_am_signed_with_role(:admin)

visit applicants_path

expect(page).to have_text("Applications")
Expand Down

0 comments on commit 10ddcb1

Please sign in to comment.