summaryrefslogtreecommitdiff
path: root/rt/t/api/user.t
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-07-10 18:15:08 -0700
committerMark Wells <mark@freeside.biz>2015-07-10 18:15:08 -0700
commit88bf5db0cca989c51237c661a13078eef08b3674 (patch)
tree0a84e1b5e7fd239f57fab678bf40c5311b0064a0 /rt/t/api/user.t
parent9c15ffe3a5ee987e30e10c6a0ad1b5bf0b2a12e3 (diff)
parente7eb845db1afab1cbdbc34ff9c387c5ac554659e (diff)
Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into 4.x
Diffstat (limited to 'rt/t/api/user.t')
-rw-r--r--rt/t/api/user.t31
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;
+}
+