From 1e5b2dc27828a741641f19f187ba52c4851cdc93 Mon Sep 17 00:00:00 2001 From: Richard Pattinson Date: Fri, 10 Jan 2025 15:03:48 +0000 Subject: [PATCH] test --- app/controllers/application_controller.rb | 2 +- app/controllers/start_controller.rb | 5 +++++ config/routes.rb | 2 ++ spec/requests/authentication_spec.rb | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 app/controllers/start_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b965fad6..9b39d4f9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -31,7 +31,7 @@ def current_dsi_user def authenticate_dsi_user! if current_dsi_user.blank? flash[:warning] = "You need to sign in to continue." - redirect_to sign_in_path + redirect_to "/auth/dfe" end end diff --git a/app/controllers/start_controller.rb b/app/controllers/start_controller.rb new file mode 100644 index 00000000..a6ee0733 --- /dev/null +++ b/app/controllers/start_controller.rb @@ -0,0 +1,5 @@ +class StartController < ApplicationController + def start + redirect_to search_path + end +end diff --git a/config/routes.rb b/config/routes.rb index c3284bfa..914a8c25 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,8 @@ Rails.application.routes.draw do root to: "searches#new" + get "/start", to: "start#start" + get "/search", to: "searches#new" get "/result", to: "searches#show" diff --git a/spec/requests/authentication_spec.rb b/spec/requests/authentication_spec.rb index da985cb1..baecbe41 100644 --- a/spec/requests/authentication_spec.rb +++ b/spec/requests/authentication_spec.rb @@ -18,7 +18,7 @@ it "redirects to sign-in" do get "/", env: { "HTTP_AUTHORIZATION" => credentials } expect(response).to have_http_status(:redirect) - expect(response).to redirect_to("/sign-in") + expect(response).to redirect_to("/auth/dfe") end end end