[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-4-g50655b9

Shawn Moore sartak at bestpractical.com
Tue Dec 7 18:20:50 EST 2010


The branch, 3.9-trunk has been updated
       via  50655b90dcbf435210cbd8beba4e038d5fac1fd2 (commit)
      from  edcd50ef893c316bd3d3cfeb3812c218d4a17604 (commit)

Summary of changes:
 t/api/groups.t |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 50655b90dcbf435210cbd8beba4e038d5fac1fd2
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Dec 7 18:20:44 2010 -0500

    TODO tests for ForWhichCurrentUserHasRight

diff --git a/t/api/groups.t b/t/api/groups.t
index 254ba1e..49f289d 100644
--- a/t/api/groups.t
+++ b/t/api/groups.t
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use RT::Test nodata => 1, tests => 42;
+use RT::Test nodata => 1, tests => 44;
 
 RT::Group->AddRights(
     'RTxGroupRight' => 'Just a right for testing rights',
@@ -162,6 +162,27 @@ is($groups->Count, 1, "RTxGroupRight found for RTxObj2");
     ok($hacks->HasMemberRecursively($herbert->PrincipalId), 'hacks has member herbert');
     ok(!$hacks->HasMemberRecursively($eric->PrincipalId), 'hacks does not have member eric');
 
+    {
+        my $groups = RT::Groups->new(RT::CurrentUser->new($eric));
+        $groups->LimitToUserDefinedGroups;
+        $groups->ForWhichCurrentUserHasRight(Right => 'RTxGroupRight');
+
+        TODO: {
+            local $TODO = "ForWhichCurrentUserHasRight still returns too many groups";
+            is_deeply([sort map { $_->Name } @{ $groups->ItemsArrayRef }], [], 'no joined groups have RTxGroupRight yet');
+        }
+    }
+
+    {
+        my $groups = RT::Groups->new(RT::CurrentUser->new($herbert));
+        $groups->LimitToUserDefinedGroups;
+        $groups->ForWhichCurrentUserHasRight(Right => 'RTxGroupRight');
+        TODO: {
+            local $TODO = "ForWhichCurrentUserHasRight still returns too many groups";
+            is_deeply([sort map { $_->Name } @{ $groups->ItemsArrayRef }], [], 'no joined groups have RTxGroupRight yet');
+        }
+    }
+
     ($ok, $msg) = $employees->PrincipalObj->GrantRight(Right => 'RTxGroupRight', Object => $employees);
     ok($ok, $msg);
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list