Bugzilla – Attachment 165885 Details for
Bug 35657
Add ability to assign tickets to librarians for catalog concerns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35657: Unit test for addition to tickets endpoint
Bug-35657-Unit-test-for-addition-to-tickets-endpoi.patch (text/plain), 2.10 KB, created by
Marcel de Rooy
on 2024-04-30 13:39:06 UTC
(
hide
)
Description:
Bug 35657: Unit test for addition to tickets endpoint
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-04-30 13:39:06 UTC
Size:
2.10 KB
patch
obsolete
>From 2d67d62778a2ef845481eebadd2b468aed06df08 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 26 Apr 2024 17:01:43 +0100 >Subject: [PATCH] Bug 35657: Unit test for addition to tickets endpoint >Content-Type: text/plain; charset=utf-8 > >This patch adds a unit test for the additional option of now setting the >assignee from the tickets update endpoint. > >Signed-off-by: Paul Derscheid <paulderscheid@gmail.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/api/v1/tickets.t | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/api/v1/tickets.t b/t/db_dependent/api/v1/tickets.t >index dcb68df109..05a2d6d277 100755 >--- a/t/db_dependent/api/v1/tickets.t >+++ b/t/db_dependent/api/v1/tickets.t >@@ -252,7 +252,7 @@ subtest 'add() tests' => sub { > > subtest 'update() tests' => sub { > >- plan tests => 15; >+ plan tests => 20; > > $schema->storage->txn_begin; > >@@ -276,7 +276,8 @@ subtest 'update() tests' => sub { > $patron->set_password( { password => $password, skip_validation => 1 } ); > my $unauth_userid = $patron->userid; > >- my $ticket_id = $builder->build_object( { class => 'Koha::Tickets' } )->id; >+ my $ticket = $builder->build_object( { class => 'Koha::Tickets' } ); >+ my $ticket_id = $ticket->id; > > # Unauthorized attempt to update > $t->put_ok( >@@ -305,6 +306,16 @@ subtest 'update() tests' => sub { > $ticket_with_updated_field )->status_is(200) > ->json_is( '/title' => 'Test ticket update' ); > >+ # Set the assignee on PUT >+ $ticket_with_updated_field->{assignee_id} = $librarian->id; >+ $t->put_ok( "//$userid:$password@/api/v1/tickets/$ticket_id" => json => >+ $ticket_with_updated_field )->status_is(200) >+ ->json_is( '/title' => 'Test ticket update' ) >+ ->json_is( '/assignee_id' => $librarian->id ); >+ >+ my $updates = $ticket->updates; >+ is( $updates->count, 1, "Ticket update added for assignee change" ); >+ > # Authorized attempt to write invalid data > my $ticket_with_invalid_field = { > blah => "Ticket Blah", >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35657
:
160365
|
160366
|
160367
|
160368
|
160369
|
160372
|
160373
|
160374
|
160375
|
160376
|
160377
|
164923
|
164924
|
164925
|
164926
|
164927
|
164928
|
164932
|
164933
|
164934
|
164935
|
164974
|
164975
|
164976
|
164977
|
165666
|
165667
|
165668
|
165669
|
165670
|
165671
|
165672
|
165673
|
165674
|
165675
|
165676
|
165677
|
165678
|
165679
|
165786
|
165787
|
165788
|
165789
|
165790
|
165791
|
165792
|
165878
|
165879
|
165880
|
165881
|
165882
|
165883
|
165884
| 165885 |
165886
|
166067