@@ -, +, @@ --- 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 --- a/t/db_dependent/api/v1/holds.t +++ a/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' ); --- a/t/lib/Mojo.pm +++ a/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; --