Revision 422008193c2650a9ca9c650dcc3fe847710025b6 authored by Clément OUDOT on 25 September 2018, 16:29:37 UTC, committed by Clément OUDOT on 25 September 2018, 16:29:37 UTC
1 parent 9446879
Raw File
60-Status.t
use Test::More;
use strict;
use IO::String;

BEGIN {
    require 't/test-lib.pm';
}

my $res;

my $client = LLNG::Manager::Test->new(
    {
        ini => {
            logLevel       => 'error',
            portalStatus   => 1,
            authentication => 'Demo',
            userDB         => 'Same',
        }
    }
);

ok(
    $res = $client->_post(
        '/',
        IO::String->new('user=dwho&password=dwho'),
        length => 23
    ),
    'Auth query'
);
count(1);
expectOK($res);
my $id = expectCookie($res);

ok( $res = $client->_get('/portalStatus'), 'Get status' );
count(1);
expectOK($res);
eval { $res = JSON::from_json( $res->[2]->[0] ) };

ok( !$@, 'Content is JSON' ) or print STDERR Dumper($@);
count(1);

ok( $res->{storage}->{global} == 1,     'Found 1 session' );
ok( $res->{storage}->{persistent} == 1, 'Found 1 persistent session' );
count(2);

clean_sessions();

done_testing( count() );
back to top