Sha256: f8976e62530d09c052f86b0960b65a70225da8f05a794924a4fa8b1268625886

Contents?: true

Size: 825 Bytes

Versions: 106

Compression:

Stored size: 825 Bytes

Contents

RSpec.describe ApplicationController, type: :controller do
  controller do
    before_action :authenticate_user!
    def index; end
  end
  describe "authentication failure handling" do
    describe "when shibboleth user authentication is required" do
      before { allow(Ddr::Auth).to receive(:require_shib_user_authn) { true } }
      it "should redirect to the shib authn path" do
        get :index
        expect(response).to redirect_to(user_omniauth_authorize_path(:shibboleth))
      end
    end
    describe "when shibboleth user authentication is not required" do
      before { allow(Ddr::Auth).to receive(:require_shib_user_authn) { false } }
      it "should redirect to the new user session path" do
        get :index
        expect(response).to redirect_to(new_user_session_path)
      end
    end
  end
end

Version data entries

106 entries across 106 versions & 1 rubygems

Version Path
ddr-models-2.4.8 spec/controllers/application_controller_spec.rb
ddr-models-2.4.7 spec/controllers/application_controller_spec.rb
ddr-models-2.4.6 spec/controllers/application_controller_spec.rb
ddr-models-2.4.5 spec/controllers/application_controller_spec.rb
ddr-models-2.4.4 spec/controllers/application_controller_spec.rb
ddr-models-2.4.3 spec/controllers/application_controller_spec.rb
ddr-models-2.4.2 spec/controllers/application_controller_spec.rb
ddr-models-2.4.1 spec/controllers/application_controller_spec.rb
ddr-models-2.4.0 spec/controllers/application_controller_spec.rb
ddr-models-2.4.0.rc6 spec/controllers/application_controller_spec.rb
ddr-models-2.4.0.rc5 spec/controllers/application_controller_spec.rb
ddr-models-2.4.0.rc4 spec/controllers/application_controller_spec.rb
ddr-models-2.4.0.rc3 spec/controllers/application_controller_spec.rb
ddr-models-2.4.0.rc2 spec/controllers/application_controller_spec.rb
ddr-models-2.4.0.rc1 spec/controllers/application_controller_spec.rb
ddr-models-2.3.2 spec/controllers/application_controller_spec.rb
ddr-models-2.3.1 spec/controllers/application_controller_spec.rb
ddr-models-3.0.0.alpha.3 spec/controllers/application_controller_spec.rb
ddr-models-2.3.0 spec/controllers/application_controller_spec.rb
ddr-models-3.0.0.alpha.2 spec/controllers/application_controller_spec.rb