From 528e677bdc21c417cf031e727a6fe60514864214 Mon Sep 17 00:00:00 2001 From: thiago Date: Tue, 2 Dec 2014 11:45:50 -0200 Subject: [PATCH] New tests when path is RemoteUser --- lib/omniauth/strategies/remote_user.rb | 16 ++++++++-------- spec/omniauth/strategies/remote_user_spec.rb | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/omniauth/strategies/remote_user.rb b/lib/omniauth/strategies/remote_user.rb index 5260fd5..1daba79 100644 --- a/lib/omniauth/strategies/remote_user.rb +++ b/lib/omniauth/strategies/remote_user.rb @@ -2,7 +2,7 @@ module OmniAuth module Strategies class RemoteUser include OmniAuth::Strategy - + option :cookie, '_gitlab_session' option :internal_cookie, '_remote_user' @@ -65,8 +65,8 @@ module OmniAuth def redirect_if_not_logging_in(request, url) if ! [ - auth_path, - callback_path + auth_path, + callback_path ].include?(request.path_info) response = Rack::Response.new response.redirect url @@ -94,17 +94,17 @@ module OmniAuth end def callback_path - "#{auth_path}/callback" + "#{auth_path}/callback" end def auth_path - "#{path_prefix}/RemoteUser" + "#{path_prefix}/RemoteUser" end - + def sign_out_path - '/users/sign_out' + '/users/sign_out' end - + end end end diff --git a/spec/omniauth/strategies/remote_user_spec.rb b/spec/omniauth/strategies/remote_user_spec.rb index f728d6d..e37ace9 100644 --- a/spec/omniauth/strategies/remote_user_spec.rb +++ b/spec/omniauth/strategies/remote_user_spec.rb @@ -85,7 +85,7 @@ describe 'Test Strategy Remote_User' do context 'Verify omniauth hash with REMOTE_USER_DATA' do before(:each){ clear_cookies - post '/auth/remoteuser/callback', {}, { 'HTTP_REMOTE_USER' => 'foobar', + post '/auth/RemoteUser/callback', {}, { 'HTTP_REMOTE_USER' => 'foobar', 'HTTP_REMOTE_USER_DATA' => JSON.dump({'name' => 'foobar', 'email' => 'foobar@test.com'})} } @@ -102,7 +102,7 @@ describe 'Test Strategy Remote_User' do context 'Verify omniauth.auth info without REMOTE_USER_DATA' do before(:each){ clear_cookies - post '/auth/remoteuser/callback', {}, { 'HTTP_REMOTE_USER' => 'foobar' } + post '/auth/RemoteUser/callback', {}, { 'HTTP_REMOTE_USER' => 'foobar' } } it 'Verify uid' do -- libgit2 0.21.2