Bugzilla – Attachment 164788 Details for
Bug 36493
Test for GET /api/v1/cash_registers/:cash_register_id/cashups is fragile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36493: Make cashups test more robust
Bug-36493-Make-cashups-test-more-robust.patch (text/plain), 1.61 KB, created by
Marcel de Rooy
on 2024-04-12 06:26:50 UTC
(
hide
)
Description:
Bug 36493: Make cashups test more robust
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-04-12 06:26:50 UTC
Size:
1.61 KB
patch
obsolete
>From baba49963269c035d808fb74eff7d895d298ca91 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 2 Apr 2024 12:39:02 -0300 >Subject: [PATCH] Bug 36493: Make cashups test more robust >Content-Type: text/plain; charset=utf-8 > >This patch makes the test independent from existing cash registers in >the system. > >To test: >1. Enable UseCashRegisters on a fresh KTD >2. Add a cash register >3. Run: > $ ktd --shell > k$ prove t/db_dependent/api/v1/cashups.t >=> FAIL: Tests fail! >4. Apply this patch >5. Repeat 3 >=> SUCCESS: Tests pass! >6. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/api/v1/cashups.t | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/cashups.t b/t/db_dependent/api/v1/cashups.t >index 4dcb4ae6a6..ab7646d0f9 100755 >--- a/t/db_dependent/api/v1/cashups.t >+++ b/t/db_dependent/api/v1/cashups.t >@@ -63,7 +63,11 @@ subtest 'list() tests' => sub { > > ## Authorized user tests > # No cash register, so 404 should be returned >- $t->get_ok("//$userid:$password@/api/v1/cash_registers/1/cashups") >+ my $cash_register_to_delete = $builder->build_object( { class => 'Koha::Cash::Registers' } ); >+ my $non_existent_cr_id = $cash_register_to_delete->id; >+ $cash_register_to_delete->delete; >+ >+ $t->get_ok("//$userid:$password@/api/v1/cash_registers/$non_existent_cr_id/cashups") > ->status_is(404)->json_is( '/error' => 'Register not found' ); > > my $register = $builder->build_object( >-- >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 36493
:
164285
|
164288
| 164788