++ed by:
AVKHOZOV KES JONASBN

3 PAUSE users
1 non-PAUSE user.

Andrey Khozov
and 4 contributors

NAME

Test::Mojo::Role::Session - Testing session in Mojolicious applications

SYNOPSIS

  use Mojolicious::Lite;
  use Test::More;
  use Test::Mojo::WithRoles 'Session';

  get '/set' => sub {
    my $c = shift;
    $c->session(s1 => 'session data');
    $c->session(s3 => [1, 3]);
    $c->render(text => 's1');
  } => 'set';

  my $t = Test::Mojo::WithRoles->new;
  $t->get_ok('/set')
    ->status_is(200)
    ->session_ok
    ->session_has('/s1')
    ->session_is('/s1' => 'session data')
    ->session_hasnt('/s2')
    ->session_is('/s3' => [1, 3]);

  done_testing();

DESCRIPTION

Test::Mojo::Role::Session is an role for the Test::Mojo::WithRoles, which allows you to conveniently test session in Mojolicious applications.

METHODS

Test::Mojo::Role::Sesssion has the same methods as Test::Mojo::Session.

SEE ALSO

Test::Mojo::WithRoles.