diff options
author | Aitik Dandapat <adandapa@redhat.com> | 2021-09-17 16:39:52 +0530 |
---|---|---|
committer | Jeff Fearn <jfearn@redhat.com> | 2021-11-16 14:49:01 +1000 |
commit | 37b29883dc3d5c20835887fd539ee6011db9e5e5 (patch) | |
tree | a5b1ea8bdb2884552708d96434c4ec23fb87adbd /t/300rpc.t | |
parent | Bug 2023136 - Log user name for account disabled log entry (diff) | |
download | bugzilla-37b29883dc3d5c20835887fd539ee6011db9e5e5.tar.gz bugzilla-37b29883dc3d5c20835887fd539ee6011db9e5e5.tar.bz2 bugzilla-37b29883dc3d5c20835887fd539ee6011db9e5e5.zip |
Bug 2005292 - Red Hat Bugzilla doesn't allow to specify only comments ids in query's include_fields
Removed the type field
Change-Id: I98451cbe1edcfee18e63720c88058d7c139e01d1
Diffstat (limited to 't/300rpc.t')
-rw-r--r-- | t/300rpc.t | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/t/300rpc.t b/t/300rpc.t index 38003f50d..cb5d620a4 100644 --- a/t/300rpc.t +++ b/t/300rpc.t @@ -4,7 +4,9 @@ use strict; use warnings; use lib qw(. lib t); -use Test::More tests => 79; + +# Each call to run_rpc adds 3 tests +use Test::More tests => 87; use Capture::Tiny ':all'; use HTTP::Parser; @@ -137,6 +139,28 @@ $res = run_rpc('Bug.get', \%args); %args = (ids => [$bug_id], status => 'ASSIGNED',); $res = run_rpc('Bug.update', \%args); +# Bug 2005292 - 'comments.id' should return only ID +%args = (ids => [$bug_id], include_fields => ['id', 'comments.id']); +$res = run_rpc('Bug.search', \%args); +ok( + exists $res->{'result'}->{'bugs'} + && exists $res->{'result'}->{'bugs'}->[0]->{'comments'} + && exists $res->{'result'}->{'bugs'}->[0]->{'comments'}->[0]->{'id'} + && scalar keys(%{$res->{'result'}->{'bugs'}->[0]->{'comments'}->[0]}) == 1, + 'Comments have 1 key and it is "id"' +) || diag(explain $res); + +# Bug 2005292 - 'comments' should return more that ID +%args = (ids => [$bug_id], include_fields => ['id', 'comments']); +$res = run_rpc('Bug.search', \%args); +ok( + exists $res->{'result'}->{'bugs'} + && exists $res->{'result'}->{'bugs'}->[0]->{'comments'} + && exists $res->{'result'}->{'bugs'}->[0]->{'comments'}->[0]->{'id'} + && scalar keys(%{$res->{'result'}->{'bugs'}->[0]->{'comments'}->[0]}) > 1, + 'Comments have more than 1 key' +) || diag(explain $res); + #flagtype %args = ( name => 'TheFlag', @@ -256,6 +280,10 @@ sub run_rpc { params => ($params || {}), ); + if ($rpc_debug) { + diag explain \%args; + } + $cgi->delete_all(); $cgi->cgi_error(""); $cgi->param('POSTDATA', to_json(\%args)); |