Bugzilla – Attachment 114314 Details for
Bug 27190
Debug REST API tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27190: Test::Mojo - Always warn the error string on error
Bug-27190-TestMojo---Always-warn-the-error-string-.patch (text/plain), 1.90 KB, created by
Jonathan Druart
on 2020-12-10 15:57:16 UTC
(
hide
)
Description:
Bug 27190: Test::Mojo - Always warn the error string on error
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-12-10 15:57:16 UTC
Size:
1.90 KB
patch
obsolete
>From c3488c076d6e12f61528e4267b01d703562042c6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 10 Dec 2020 16:55:55 +0100 >Subject: [PATCH] Bug 27190: Test::Mojo - Always warn the error string on error > >--- > t/db_dependent/api/v1/holds.t | 7 ++++--- > t/lib/Mojo.pm | 12 ++++++++++++ > 2 files changed, 16 insertions(+), 3 deletions(-) > create mode 100644 t/lib/Mojo.pm > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index cb683fd819..b8090ca592 100755 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -43,8 +43,8 @@ my $builder = t::lib::TestBuilder->new(); > $schema->storage->txn_begin; > > t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); >- >-my $t = Test::Mojo->new('Koha::REST::V1'); >+use t::lib::Mojo; >+my $t = t::lib::Mojo->new('Koha::REST::V1'); > > my $categorycode = $builder->build({ source => 'Category' })->{categorycode}; > my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; >@@ -832,7 +832,8 @@ subtest 'PUT /holds/{hold_id}/pickup_location tests' => sub { > > $t->put_ok( "//$userid:$password@/api/v1/holds/" > . $hold->id >- . "/pickup_location" => json => $library_2->branchcode )->status_is(200)->json_is($library_2->branchcode); >+ . "/pickup_location" => json => $library_2->branchcode ) >+ ->status_is(200)->json_is( $library_2->branchcode ); > > is( $hold->discard_changes->branchcode->branchcode, $library_2->branchcode, 'pickup library adjusted correctly' ); > >diff --git a/t/lib/Mojo.pm b/t/lib/Mojo.pm >new file mode 100644 >index 0000000000..f53d09ce9e >--- /dev/null >+++ b/t/lib/Mojo.pm >@@ -0,0 +1,12 @@ >+package t::lib::Mojo; >+ >+use base qw(Test::Mojo); >+ >+sub test { >+ my ($self, @params) = @_; >+ my $ok = $self->SUPER::test(@params); >+ warn "DIAG: " . $self->tx->res->to_string unless $ok->success; >+ return $ok >+} >+ >+1; >-- >2.20.1
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 27190
:
114313
| 114314