From 8c17b11ab61b323d7b0d070c5810813021f14a76 Mon Sep 17 00:00:00 2001 From: Macartur Sousa Date: Thu, 20 Aug 2015 10:59:53 -0300 Subject: [PATCH] Added test to redirect after log in --- spec/omniauth/strategies/remote_user_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+), 0 deletions(-) diff --git a/spec/omniauth/strategies/remote_user_spec.rb b/spec/omniauth/strategies/remote_user_spec.rb index 41bccf5..1728c33 100644 --- a/spec/omniauth/strategies/remote_user_spec.rb +++ b/spec/omniauth/strategies/remote_user_spec.rb @@ -122,4 +122,17 @@ describe 'Test Strategy Remote_User' do end end + context 'Redirect After login in' do + before(:each){ + set_cookie '_remote_user=foobar' + set_cookie '_last_path=/dashboard' + get '/', {}, { 'HTTP_REMOTE_USER' => 'foobar' } + } + + it 'redirect to last path before login' do + expect(last_response.status).to eq(302) + expect(last_response.location).to eq('/dashboard') + end + end + end -- libgit2 0.21.2