Support e.g. ->roles in User::Hash if set appropriately
[catagits/Catalyst-Plugin-Authentication.git] / t / live_app.t
index 8802f04..b2070c2 100644 (file)
@@ -26,10 +26,16 @@ use Test::More 'no_plan';
                ok(!$c->user, "no user");
                ok($c->login( "foo", "s3cr3t" ), "can login with clear");
                is( $c->user, $users->{foo}, "user object is in proper place");
-               $c->logout;
 
+               ok( !$c->user->roles, "no roles for foo" );
+               my @new = qw/foo bar gorch/;
+               $c->user->roles( @new );
+               is_deeply( [ $c->user->roles ], \@new, "roles set as array");
+
+               $c->logout;
                ok(!$c->user, "no more user, after logout");
 
+
                ok($c->login( "bar", "s3cr3t" ), "can login with crypted");
                is( $c->user, $users->{bar}, "user object is in proper place");
                $c->logout;
@@ -42,6 +48,8 @@ use Test::More 'no_plan';
                ok(!$c->user, "no user");
 
                throws_ok { $c->login( "baz", "foo" ) } qr/support.*mechanism/, "can't login without any supported mech";
+
+               
        }
 
        __PACKAGE__->config->{authentication}{users} = $users = {