[Bps-public-commit] rt-extension-rest2 branch master updated. 1.14-10-gce1fc17

BPS Git Server git at git.bestpractical.com
Thu Apr 14 20:47:59 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-rest2".

The branch, master has been updated
       via  ce1fc176f3dc0ef4bca2cfe01557f71580c29be7 (commit)
      from  2353884d3e48888eee918924902a52a9cb351f2f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ce1fc176f3dc0ef4bca2cfe01557f71580c29be7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Apr 15 04:37:12 2022 +0800

    Update tests for the custom field error message change in 4.4.6
    
    See also 6d9093c6a0 in RT

diff --git a/xt/asset-customfields.t b/xt/asset-customfields.t
index acfc955..659f60f 100644
--- a/xt/asset-customfields.t
+++ b/xt/asset-customfields.t
@@ -188,7 +188,12 @@ my $no_asset_cf_values = bag(
         local $TODO = "RT ->Update isn't introspectable";
         is($res->code, 403);
     };
-    is_deeply($mech->json_response, ['Asset Asset creation using REST: Permission Denied', 'Asset Asset creation using REST: Permission Denied', 'Could not add new custom field value: Permission Denied']);
+
+    my $cf_error
+        = RT::Handle::cmp_version( $RT::VERSION, '4.4.6' ) >= 0
+        ? "Could not add a new value to custom field 'Single': Permission Denied"
+        : 'Could not add new custom field value: Permission Denied';
+    is_deeply($mech->json_response, ['Asset Asset creation using REST: Permission Denied', 'Asset Asset creation using REST: Permission Denied', $cf_error]);
 
     $user->PrincipalObj->GrantRight( Right => 'ModifyAsset' );
 
@@ -197,7 +202,7 @@ my $no_asset_cf_values = bag(
         'Authorization' => $auth,
     );
     is($res->code, 200);
-    is_deeply($mech->json_response, ["Asset Asset update using REST: Name changed from 'Asset creation using REST' to 'Asset update using REST'", "Asset Asset update using REST: Status changed from 'new' to 'allocated'", 'Could not add new custom field value: Permission Denied']);
+    is_deeply($mech->json_response, ["Asset Asset update using REST: Name changed from 'Asset creation using REST' to 'Asset update using REST'", "Asset Asset update using REST: Status changed from 'new' to 'allocated'", $cf_error]);
 
     $res = $mech->get($asset_url,
         'Authorization' => $auth,
diff --git a/xt/ticket-customfields.t b/xt/ticket-customfields.t
index 66c6915..12c9d31 100644
--- a/xt/ticket-customfields.t
+++ b/xt/ticket-customfields.t
@@ -285,7 +285,12 @@ my $no_ticket_cf_values = bag(
         local $TODO = "RT ->Update isn't introspectable";
         is($res->code, 403);
     };
-    is_deeply($mech->json_response, ['Ticket 1: Permission Denied', 'Ticket 1: Permission Denied', 'Could not add new custom field value: Permission Denied']);
+
+    my $cf_error
+        = RT::Handle::cmp_version( $RT::VERSION, '4.4.6' ) >= 0
+        ? "Could not add a new value to custom field 'Single': Permission Denied"
+        : 'Could not add new custom field value: Permission Denied';
+    is_deeply($mech->json_response, ['Ticket 1: Permission Denied', 'Ticket 1: Permission Denied', $cf_error]);
 
     $user->PrincipalObj->GrantRight( Right => 'ModifyTicket' );
 
@@ -294,7 +299,7 @@ my $no_ticket_cf_values = bag(
         'Authorization' => $auth,
     );
     is($res->code, 200);
-    is_deeply($mech->json_response, ["Ticket 1: Priority changed from (no value) to '42'", "Ticket 1: Subject changed from 'Ticket creation using REST' to 'Ticket update using REST'", 'Could not add new custom field value: Permission Denied']);
+    is_deeply($mech->json_response, ["Ticket 1: Priority changed from (no value) to '42'", "Ticket 1: Subject changed from 'Ticket creation using REST' to 'Ticket update using REST'", $cf_error]);
 
     $res = $mech->get($ticket_url,
         'Authorization' => $auth,
diff --git a/xt/user-customfields.t b/xt/user-customfields.t
index d46a1c0..2527db3 100644
--- a/xt/user-customfields.t
+++ b/xt/user-customfields.t
@@ -114,7 +114,15 @@ my $no_user_cf_values = bag(
         'Authorization' => $auth,
     );
     is($res->code, 200);
-    is_deeply($mech->json_response, ["User User1: Name changed from 'user1' to 'User1'", 'Could not add new custom field value: Permission Denied']);
+    is_deeply(
+        $mech->json_response,
+        [
+            "User User1: Name changed from 'user1' to 'User1'",
+            RT::Handle::cmp_version( $RT::VERSION, '4.4.6' ) >= 0
+            ? "Could not add a new value to custom field 'Freeform': Permission Denied"
+            : 'Could not add new custom field value: Permission Denied',
+        ]
+    );
 
     $res = $mech->get($user_url,
         'Authorization' => $auth,

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

Summary of changes:
 xt/asset-customfields.t  |  9 +++++++--
 xt/ticket-customfields.t |  9 +++++++--
 xt/user-customfields.t   | 10 +++++++++-
 3 files changed, 23 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
rt-extension-rest2


More information about the Bps-public-commit mailing list