Fix session leak from this test.
This commit is contained in:
parent
d02472cfa6
commit
cd0986ecdf
1 changed files with 7 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ use Plack::Test;
|
|||
use Plack::Builder;
|
||||
use HTTP::Request::Common;
|
||||
use Test::More;
|
||||
use WebGUI::Test::Mechanize;
|
||||
use HTTP::Exception;
|
||||
|
||||
my $wg = WebGUI->new(config => WebGUI::Test->config);
|
||||
|
|
@ -59,6 +60,12 @@ test_psgi $regular_app, sub {
|
|||
my $res = $cb->( GET "/" );
|
||||
is $res->code, 200, 'regular app, status code';
|
||||
like $res->content, qr/My Company/, 'testing regular app';
|
||||
use Data::Dumper;
|
||||
my ($sessionId) = $res->header('Set-Cookie') =~ /wgSession=(\w{22})/;
|
||||
if ($sessionId) {
|
||||
my $session = WebGUI::Session->open(WebGUI::Test->config, undef, $sessionId);
|
||||
$session->end;
|
||||
}
|
||||
};
|
||||
|
||||
# N.B. The die() is caught thanks to WebGUI::Middleware::HTTPExceptions,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue