Improve unit test (#1878)
This commit is contained in:
parent
9dac92064c
commit
d565dc66c3
|
@ -18,7 +18,16 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
ok( $res = $client->_get( '/', accept => 'text/html' ), 'Get Menu' );
|
ok(
|
||||||
|
$res = $client->_get(
|
||||||
|
'/',
|
||||||
|
query => 'url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tLw==',
|
||||||
|
accept => 'text/html'
|
||||||
|
),
|
||||||
|
'Get Menu'
|
||||||
|
);
|
||||||
|
my $pdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
$res->[2]->[0] =~
|
$res->[2]->[0] =~
|
||||||
m%<script type="application/init">\{"sslHost":"https://authssl.example.com:19876"\}</script>%,
|
m%<script type="application/init">\{"sslHost":"https://authssl.example.com:19876"\}</script>%,
|
||||||
|
@ -32,12 +41,19 @@ ok( $res->[2]->[0] =~ /ssl\.(?:min\.)?js/, 'Get sslChoice javascript' )
|
||||||
count(4);
|
count(4);
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
$res = $client->_get( '/', custom => { SSL_CLIENT_S_DN_Custom => 'dwho' } ),
|
$res = $client->_get(
|
||||||
|
'/',
|
||||||
|
cookie => $pdata,
|
||||||
|
accept => 'text/html',
|
||||||
|
custom => { SSL_CLIENT_S_DN_Custom => 'dwho' }
|
||||||
|
),
|
||||||
'Auth query'
|
'Auth query'
|
||||||
);
|
);
|
||||||
expectOK($res);
|
|
||||||
expectCookie($res);
|
expectCookie($res);
|
||||||
count(1);
|
expectRedirection( $res, 'http://test1.example.com/' );
|
||||||
|
$pdata = expectCookie( $res, 'lemonldappdata' );
|
||||||
|
ok( $pdata eq '', 'pdata is empty' );
|
||||||
|
count(2);
|
||||||
|
|
||||||
&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 );
|
&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 );
|
||||||
$client = LLNG::Manager::Test->new( {
|
$client = LLNG::Manager::Test->new( {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user