diff options
Diffstat (limited to 't/app/controller/auth_social.t')
-rw-r--r-- | t/app/controller/auth_social.t | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/app/controller/auth_social.t b/t/app/controller/auth_social.t index 3a0539452..62ab0b60f 100644 --- a/t/app/controller/auth_social.t +++ b/t/app/controller/auth_social.t @@ -63,6 +63,7 @@ for my $test ( secret => 'example_secret_key', auth_uri => 'http://oidc.example.org/oauth2/v2.0/authorize', token_uri => 'http://oidc.example.org/oauth2/v2.0/token', + logout_uri => 'http://oidc.example.org/oauth2/v2.0/logout', display_name => 'MyWestminster' } } @@ -76,6 +77,7 @@ for my $test ( error_callback => '/auth/OIDC?error=ERROR', success_callback => '/auth/OIDC?code=response-code&state=login', redirect_pattern => qr{oidc\.example\.org/oauth2/v2\.0/authorize}, + logout_redirect_pattern => qr{oidc\.example\.org/oauth2/v2\.0/logout}, user_extras => [ [westminster_account_id => "1c304134-ef12-c128-9212-123908123901"], ], @@ -227,6 +229,16 @@ for my $state ( 'refused', 'no email', 'existing UID', 'okay' ) { } } } + + $mech->get('/auth/sign_out'); + if ($test->{type} eq 'oidc' && $state ne 'refused' && $state ne 'no email') { + # XXX the 'no email' situation is skipped because of some confusion + # with the hosts/sessions that I've not been able to get to the bottom of. + # The code does behave as expected when testing manually, however. + is $mech->res->previous->code, 302, "$test->{type} sign out redirected"; + like $mech->res->previous->header('Location'), $test->{logout_redirect_pattern}, "$test->{type} sign out redirect to oauth logout URL"; + } + $mech->not_logged_in_ok; } } } |