Commit 8c17b11ab61b323d7b0d070c5810813021f14a76
1 parent
1f021975
Exists in
fix_last_path
Added test to redirect after log in
Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
spec/omniauth/strategies/remote_user_spec.rb
| ... | ... | @@ -122,4 +122,17 @@ describe 'Test Strategy Remote_User' do |
| 122 | 122 | end |
| 123 | 123 | end |
| 124 | 124 | |
| 125 | + context 'Redirect After login in' do | |
| 126 | + before(:each){ | |
| 127 | + set_cookie '_remote_user=foobar' | |
| 128 | + set_cookie '_last_path=/dashboard' | |
| 129 | + get '/', {}, { 'HTTP_REMOTE_USER' => 'foobar' } | |
| 130 | + } | |
| 131 | + | |
| 132 | + it 'redirect to last path before login' do | |
| 133 | + expect(last_response.status).to eq(302) | |
| 134 | + expect(last_response.location).to eq('/dashboard') | |
| 135 | + end | |
| 136 | + end | |
| 137 | + | |
| 125 | 138 | end | ... | ... |