diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
commit | 9aee669886202be7035e6c6049fc71bc99dd3013 (patch) | |
tree | 2fd5bf6de74f3d99270587ffb1833e4188a6373d /rt/t/api/user.t | |
parent | ac20214d38d9af00430423f147b5a0e50751b050 (diff) | |
parent | 1add633372bdca3cc7163c2ce48363fed3984437 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'rt/t/api/user.t')
-rw-r--r-- | rt/t/api/user.t | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/rt/t/api/user.t b/rt/t/api/user.t index e6b891f73..94494f162 100644 --- a/rt/t/api/user.t +++ b/rt/t/api/user.t @@ -2,7 +2,7 @@ use strict; use warnings; use RT; -use RT::Test tests => 111; +use RT::Test tests => 122; { @@ -106,7 +106,7 @@ ok($user->Privileged, "User 'root' is privileged again"); ok(my $u = RT::User->new(RT->SystemUser)); ok($u->Load(1), "Loaded the first user"); -is($u->PrincipalObj->ObjectId , 1, "user 1 is the first principal"); +is($u->PrincipalObj->id , 1, "user 1 is the first principal"); is($u->PrincipalObj->PrincipalType, 'User' , "Principal 1 is a user, not a group"); @@ -335,3 +335,30 @@ ok($rqv, "Revoked the right successfully - $rqm"); } +{ + my $root = RT::Test->load_or_create_user( Name => 'root' ); + ok $root && $root->id; + + my $queue = RT::Test->load_or_create_queue( Name => 'General' ); + ok $queue && $queue->id; + + my $ticket = RT::Ticket->new( RT->SystemUser ); + my ($id) = $ticket->Create( Subject => 'test', Queue => $queue ); + ok $id; + + my $b_ticket = RT::Ticket->new( RT->SystemUser ); + ($id) = $b_ticket->Create( Subject => 'test', Queue => $queue ); + ok $id; + + ok $root->ToggleBookmark($b_ticket); + ok !$root->ToggleBookmark($b_ticket); + ok $root->ToggleBookmark($b_ticket); + + ok $root->HasBookmark( $b_ticket ); + ok !$root->HasBookmark( $ticket ); + + my @marks = $root->Bookmarks; + is scalar @marks, 1; + is $marks[0], $b_ticket->id; +} + |