[Rt-commit] rt branch, 5.0/rest2-tests-tickets-orderby, created. rt-5.0.1-427-gbabcef1c04

? sunnavy sunnavy at bestpractical.com
Wed Jun 2 17:12:56 EDT 2021


The branch, 5.0/rest2-tests-tickets-orderby has been created
        at  babcef1c046b0c3da9eabcc9655edb79c2bde1a7 (commit)

- Log -----------------------------------------------------------------
commit babcef1c046b0c3da9eabcc9655edb79c2bde1a7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jun 3 04:46:38 2021 +0800

    Specify orderby as following tests assume tickets are returned in order
    
    Although most of the time tickets are ordered by id without explicitly
    saying so, it's not wrong for database to return in a random order and
    tests could fail when this happens(we encountered this when testing with
    Apache+Pg9.6).

diff --git a/t/rest2/ticket-customfields.t b/t/rest2/ticket-customfields.t
index 88722942b9..e148cb36b7 100644
--- a/t/rest2/ticket-customfields.t
+++ b/t/rest2/ticket-customfields.t
@@ -159,7 +159,7 @@ my $no_ticket_cf_values = bag(
 
 # Rights Test - Searching asking for CustomFields without SeeCustomField
 {
-    my $res = $mech->get("$rest_base_path/tickets?query=id>0&fields=Status,Owner,CustomFields,Subject&fields[Owner]=Name",
+    my $res = $mech->get("$rest_base_path/tickets?query=id>0&fields=Status,Owner,CustomFields,Subject&fields[Owner]=Name&orderby=id",
         'Authorization' => $auth,
     );
     is($res->code, 200);
@@ -571,7 +571,7 @@ for my $value (
 
     # Ticket Show - Fields, custom fields
     {
-        $res = $mech->get("$rest_base_path/tickets?query=id>0&fields=Status,Owner,CustomFields,Subject&fields[Owner]=Name",
+        $res = $mech->get("$rest_base_path/tickets?query=id>0&fields=Status,Owner,CustomFields,Subject&fields[Owner]=Name&orderby=id",
             'Authorization' => $auth,
         );
         is($res->code, 200);

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


More information about the rt-commit mailing list