diff --git a/Gemfile b/Gemfile index 54d5fc0..48c911c 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,7 @@ gem 'geoblacklight', '~> 4.1.1' gem 'importmap-rails' gem 'jbuilder' gem 'jquery-rails' +gem 'omniauth', '< 2.0' gem 'omniauth-cas' gem 'pg', '~> 1.4.6' gem 'puma', '~> 6.4.1' diff --git a/Gemfile.lock b/Gemfile.lock index c7126b9..27dd19f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -272,14 +272,13 @@ GEM racc (~> 1.4) oj (3.16.3) bigdecimal (>= 3.0) - omniauth (2.1.2) + omniauth (1.9.2) hashie (>= 3.4.6) - rack (>= 2.2.3) - rack-protection - omniauth-cas (3.0.0) - addressable (~> 2.8) - nokogiri (~> 1.12) - omniauth (~> 2.1) + rack (>= 1.6.2, < 3) + omniauth-cas (2.0.0) + addressable (~> 2.3) + nokogiri (~> 1.5) + omniauth (~> 1.2) orm_adapter (0.5.0) ostruct (0.6.0) ougai (1.9.1) @@ -296,10 +295,7 @@ GEM puma (6.4.2) nio4r (~> 2.0) racc (1.7.3) - rack (2.2.8.1) - rack-protection (3.2.0) - base64 (>= 0.1.0) - rack (~> 2.2, >= 2.2.4) + rack (2.2.9) rack-test (2.1.0) rack (>= 1.3) rack-timeout (0.6.3) @@ -495,6 +491,7 @@ DEPENDENCIES importmap-rails jbuilder jquery-rails + omniauth (< 2.0) omniauth-cas pg (~> 1.4.6) puma (~> 6.4.1) diff --git a/spec/requests/session_spec.rb b/spec/requests/session_spec.rb index a5d3842..d1b9878 100644 --- a/spec/requests/session_spec.rb +++ b/spec/requests/session_spec.rb @@ -12,4 +12,10 @@ get destroy_user_session_path expect(response).to have_http_status(302) end + + it 'redirects to auth.berkeley.edu' do + get user_calnet_omniauth_authorize_path + expect(response).to have_http_status(302) + expect(response.location).to match(%r{https://auth-test.berkeley.edu}) + end end diff --git a/spec/system/application_system_spec.rb b/spec/system/application_system_spec.rb index 5f638c1..1b2c688 100644 --- a/spec/system/application_system_spec.rb +++ b/spec/system/application_system_spec.rb @@ -5,7 +5,7 @@ driven_by(:rack_test) end - it 'can veiw restricted data' do + it 'can view restricted data' do visit '/catalog/berkeley-s7b12n' expect(page).to have_text('Login to View and Download') end