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.11.0 spec/controllers/application_controller_spec.rb
ddr-models-2.10.2 spec/controllers/application_controller_spec.rb
ddr-models-2.10.1 spec/controllers/application_controller_spec.rb
ddr-models-2.10.0 spec/controllers/application_controller_spec.rb
ddr-models-2.10.0.rc2 spec/controllers/application_controller_spec.rb
ddr-models-2.10.0.rc1 spec/controllers/application_controller_spec.rb
ddr-models-2.9.2 spec/controllers/application_controller_spec.rb
ddr-models-2.9.1 spec/controllers/application_controller_spec.rb
ddr-models-2.9.0 spec/controllers/application_controller_spec.rb
ddr-models-2.9.0.rc1 spec/controllers/application_controller_spec.rb
ddr-models-2.8.0 spec/controllers/application_controller_spec.rb
ddr-models-2.8.0.rc1 spec/controllers/application_controller_spec.rb
ddr-models-2.7.6 spec/controllers/application_controller_spec.rb
ddr-models-2.7.5 spec/controllers/application_controller_spec.rb
ddr-models-2.7.4 spec/controllers/application_controller_spec.rb
ddr-models-2.7.3 spec/controllers/application_controller_spec.rb
ddr-models-2.7.2 spec/controllers/application_controller_spec.rb
ddr-models-2.7.1 spec/controllers/application_controller_spec.rb
ddr-models-2.7.0 spec/controllers/application_controller_spec.rb
ddr-models-2.7.0.rc1 spec/controllers/application_controller_spec.rb