Bugzilla – Attachment 56288 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-tdbdependentapiv1hold.patch (text/plain), 2.46 KB, created by
Marc Véron
on 2016-10-12 14:11:37 UTC
(
hide
)
Description:
Bug 17431 - Fix failing test t/db_dependent/api/v1/holds.t
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-10-12 14:11:37 UTC
Size:
2.46 KB
patch
obsolete
>From 9e13e4241aa557e7571cd864edab834ba0f4d951 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> >--- > 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.1.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