diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 31ce2b4c..4a2b99b3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,8 +3,8 @@ class ApplicationController < ActionController::Base default_form_builder(GOVUKDesignSystemFormBuilder::FormBuilder) before_action :http_basic_authenticate, unless: -> { FeatureFlags::FeatureFlag.active?(:service_open) } - before_action :authenticate_dsi_user!, if: -> { FeatureFlags::FeatureFlag.active?(:service_open) } - before_action :handle_expired_session!, if: -> { FeatureFlags::FeatureFlag.active?(:service_open) } + before_action :authenticate_dsi_user! + before_action :handle_expired_session! def http_basic_authenticate valid_credentials = [ diff --git a/spec/requests/authentication_spec.rb b/spec/requests/authentication_spec.rb index e4ea6a8e..2f4a18fc 100644 --- a/spec/requests/authentication_spec.rb +++ b/spec/requests/authentication_spec.rb @@ -15,9 +15,10 @@ ) end - it "returns http success" do + it "redirects to sign-in" do get "/", env: { "HTTP_AUTHORIZATION" => credentials } - expect(response).to have_http_status(:success) + expect(response).to have_http_status(:redirect) + expect(response).to redirect_to("/sign-in") end end end