[Bps-public-commit] rt-extension-rest2 branch, master, updated. 1.01-1-gb37be8a

? sunnavy sunnavy at bestpractical.com
Wed Feb 28 09:15:22 EST 2018


The branch, master has been updated
       via  b37be8a811a8f1637e1e276408dd30f93b2a8acf (commit)
      from  64ca458fc72c68ff08805fd5910976eabc087f58 (commit)

Summary of changes:
 t/ticket-customroles.t |  8 ++++----
 t/ticket-watchers.t    | 24 ++++++++++++------------
 2 files changed, 16 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit b37be8a811a8f1637e1e276408dd30f93b2a8acf
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Feb 28 21:58:33 2018 +0800

    fix tests for different order of role members in different db types
    
    mysql/sqlite and pg behave differently, use bag to cover both.

diff --git a/t/ticket-customroles.t b/t/ticket-customroles.t
index fe3052a..3b692a3 100644
--- a/t/ticket-customroles.t
+++ b/t/ticket-customroles.t
@@ -352,7 +352,7 @@ $user->PrincipalObj->GrantRight( Right => $_ )
     );
     is($res->code, 200);
     $content = $mech->json_response;
-    cmp_deeply($content->{$multi->GroupType}, [{
+    cmp_deeply($content->{$multi->GroupType}, bag({
         type => 'user',
         id   => 'multi2 at example.com',
         _url => re(qr{$rest_base_path/user/multi2\@example\.com$}),
@@ -360,7 +360,7 @@ $user->PrincipalObj->GrantRight( Right => $_ )
         type => 'user',
         id   => 'multi at example.com',
         _url => re(qr{$rest_base_path/user/multi\@example\.com$}),
-    }], 'two Multi Member');
+    }), 'two Multi Member');
 
     my $users = RT::Users->new(RT->SystemUser);
     $users->UnLimit;
@@ -400,7 +400,7 @@ $user->PrincipalObj->GrantRight( Right => $_ )
         );
         is($res->code, 200);
         $content = $mech->json_response;
-        cmp_deeply($content->{$multi->GroupType}, [{
+        cmp_deeply($content->{$multi->GroupType}, bag({
             type => 'user',
             id   => 'multi2 at example.com',
             _url => re(qr{$rest_base_path/user/multi2\@example\.com$}),
@@ -408,7 +408,7 @@ $user->PrincipalObj->GrantRight( Right => $_ )
             type => 'user',
             id   => 'multi at example.com',
             _url => re(qr{$rest_base_path/user/multi\@example\.com$}),
-        }], "preserved two Multi Members when $name");
+        }), "preserved two Multi Members when $name");
     }
 }
 
diff --git a/t/ticket-watchers.t b/t/ticket-watchers.t
index d14f5f6..20446fd 100644
--- a/t/ticket-watchers.t
+++ b/t/ticket-watchers.t
@@ -366,7 +366,7 @@ $user->PrincipalObj->GrantRight( Right => $_ )
     );
     is($res->code, 200);
     $content = $mech->json_response;
-    cmp_deeply($content->{Requestor}, [{
+    cmp_deeply($content->{Requestor}, bag({
         type => 'user',
         id   => 'requestor2 at example.com',
         _url => re(qr{$rest_base_path/user/requestor2\@example\.com$}),
@@ -374,9 +374,9 @@ $user->PrincipalObj->GrantRight( Right => $_ )
         type => 'user',
         id   => 'requestor at example.com',
         _url => re(qr{$rest_base_path/user/requestor\@example\.com$}),
-    }], 'two Requestors');
+    }), 'two Requestors');
 
-    cmp_deeply($content->{Cc}, [{
+    cmp_deeply($content->{Cc}, bag({
         type => 'user',
         id   => 'cc2 at example.com',
         _url => re(qr{$rest_base_path/user/cc2\@example\.com$}),
@@ -384,9 +384,9 @@ $user->PrincipalObj->GrantRight( Right => $_ )
         type => 'user',
         id   => 'cc at example.com',
         _url => re(qr{$rest_base_path/user/cc\@example\.com$}),
-    }], 'two Ccs');
+    }), 'two Ccs');
 
-    cmp_deeply($content->{AdminCc}, [{
+    cmp_deeply($content->{AdminCc}, bag({
         type => 'user',
         id   => 'admincc2 at example.com',
         _url => re(qr{$rest_base_path/user/admincc2\@example\.com$}),
@@ -394,7 +394,7 @@ $user->PrincipalObj->GrantRight( Right => $_ )
         type => 'user',
         id   => 'admincc at example.com',
         _url => re(qr{$rest_base_path/user/admincc\@example\.com$}),
-    }], 'two AdminCcs');
+    }), 'two AdminCcs');
 
     my $users = RT::Users->new(RT->SystemUser);
     $users->UnLimit;
@@ -440,7 +440,7 @@ $user->PrincipalObj->GrantRight( Right => $_ )
         );
         is($res->code, 200);
         $content = $mech->json_response;
-        cmp_deeply($content->{Requestor}, [{
+        cmp_deeply($content->{Requestor}, bag({
             type => 'user',
             id   => 'requestor2 at example.com',
             _url => re(qr{$rest_base_path/user/requestor2\@example\.com$}),
@@ -448,9 +448,9 @@ $user->PrincipalObj->GrantRight( Right => $_ )
             type => 'user',
             id   => 'requestor at example.com',
             _url => re(qr{$rest_base_path/user/requestor\@example\.com$}),
-        }], "preserved two Requestors when $name");
+        }), "preserved two Requestors when $name");
 
-        cmp_deeply($content->{Cc}, [{
+        cmp_deeply($content->{Cc}, bag({
             type => 'user',
             id   => 'cc2 at example.com',
             _url => re(qr{$rest_base_path/user/cc2\@example\.com$}),
@@ -458,9 +458,9 @@ $user->PrincipalObj->GrantRight( Right => $_ )
             type => 'user',
             id   => 'cc at example.com',
             _url => re(qr{$rest_base_path/user/cc\@example\.com$}),
-        }], "preserved two Ccs when $name");
+        }), "preserved two Ccs when $name");
 
-        cmp_deeply($content->{AdminCc}, [{
+        cmp_deeply($content->{AdminCc}, bag({
             type => 'user',
             id   => 'admincc2 at example.com',
             _url => re(qr{$rest_base_path/user/admincc2\@example\.com$}),
@@ -468,7 +468,7 @@ $user->PrincipalObj->GrantRight( Right => $_ )
             type => 'user',
             id   => 'admincc at example.com',
             _url => re(qr{$rest_base_path/user/admincc\@example\.com$}),
-        }], "preserved two AdminCcs when $name");
+        }), "preserved two AdminCcs when $name");
     }
 }
 

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


More information about the Bps-public-commit mailing list