Bugzilla – Attachment 57600 Details for
Bug 17431
Fix failing test t/db_dependent/api/v1/holds.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17431: Fix failing test t/db_dependent/api/v1/holds.t
Bug-17431-Fix-failing-test-tdbdependentapiv1holdst.patch (text/plain), 2.63 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-11-17 14:28:51 UTC
(
hide
)
Description:
Bug 17431: Fix failing test t/db_dependent/api/v1/holds.t
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-11-17 14:28:51 UTC
Size:
2.63 KB
patch
obsolete
>From 4390e6854f908624cab4181bdd471530a0758529 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Wed, 12 Oct 2016 14:29:26 +0300 >Subject: [PATCH] Bug 17431: Fix failing test t/db_dependent/api/v1/holds.t > >This patch fixed failing test for t/db_dependent/api/v1/holds.t which was broken >after Bug 14695. > >$ perl t/db_dependent/api/v1/holds.t >... >not ok 42 - similar match for JSON Pointer "/error" > # Failed test 'similar match for JSON Pointer "/error"' > # at t/db_dependent/api/v1/holds.t line 291. > # 'Reserve cannot be placed. Reason: itemAlreadyOnHold' > # doesn't match '(?^u:tooManyReserves)' > # Looks like you failed 1 test of 42. >not ok 4 - Test endpoints with permission > >To test: >1. Run t/db_dependent/api/v1/holds.t and observe it fail. >2. Apply patch. >3. Run the test again and observe it pass. > >Signed-off-by: Marc <veron@veron.ch> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/holds.t | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 8a5f393..184beff 100644 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -110,6 +110,9 @@ $session3->flush; > my $biblionumber = create_biblio('RESTful Web APIs'); > my $itemnumber = create_item($biblionumber, 'TEST000001'); > >+my $biblionumber2 = create_biblio('RESTful Web APIs'); >+my $itemnumber2 = create_item($biblionumber2, 'TEST000002'); >+ > $dbh->do('DELETE FROM reserves'); > > my $reserve_id = C4::Reserves::AddReserve($branchcode, $borrowernumber, >@@ -204,7 +207,7 @@ subtest "Test endpoints without permission, but accessing own object" => sub { > }; > > subtest "Test endpoints with permission" => sub { >- plan tests => 42; >+ plan tests => 45; > > $tx = $t->ua->build_tx(GET => '/api/v1/holds'); > $tx->req->cookies({name => 'CGISESSID', value => $session->id}); >@@ -290,6 +293,14 @@ subtest "Test endpoints with permission" => sub { > $tx->req->cookies({name => 'CGISESSID', value => $session3->id}); > $t->request_ok($tx) > ->status_is(403) >+ ->json_like('/error', qr/itemAlreadyOnHold/); >+ >+ $post_data->{biblionumber} = int($biblionumber2); >+ $post_data->{itemnumber} = int($itemnumber2); >+ $tx = $t->ua->build_tx(POST => "/api/v1/holds" => json => $post_data); >+ $tx->req->cookies({name => 'CGISESSID', value => $session3->id}); >+ $t->request_ok($tx) >+ ->status_is(403) > ->json_like('/error', qr/tooManyReserves/); > }; > >-- >2.7.4
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 17431
:
56252
|
56288
|
56655
|
56656
|
56657
|
56658
|
57258
|
57282
|
57283
|
57284
|
57285
|
57584
|
57585
| 57600 |
57601
|
57602
|
57603