Bug 39007: Update API spec and unit test
Test plan: 1) Run prove t/db_dependent/api/v1/erm_sushi_services.t - FAIL 2) Apply patch 3) Repeat step 1 - PASS 4) Inspect patch diff and note that last_audit has been added to the API definition Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
48aad541cc
commit
5d67151107
|
|
@ -114,6 +114,9 @@ properties:
|
|||
type: array
|
||||
items:
|
||||
type: object
|
||||
last_audit:
|
||||
description: the last time the service was audited
|
||||
type: object
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ use Modern::Perl;
|
|||
|
||||
use Test::More tests => 1;
|
||||
use Test::Mojo;
|
||||
use Test::Warn;
|
||||
|
||||
use t::lib::TestBuilder;
|
||||
use t::lib::Mocks;
|
||||
|
|
@ -61,6 +62,7 @@ subtest 'get() tests' => sub {
|
|||
"id",
|
||||
"ip_address_authorization",
|
||||
"ip_address_authorization_info",
|
||||
"last_audit",
|
||||
"migrations",
|
||||
"notification_count",
|
||||
"notifications_url",
|
||||
|
|
@ -103,7 +105,11 @@ subtest 'get() tests' => sub {
|
|||
my @response_fields = map { $_ } keys %$sushi_service;
|
||||
my @new_fields_in_response = array_minus( @response_fields, @expected_fields );
|
||||
|
||||
is( scalar(@new_fields_in_response), 0, 'The response fields match the expected fields' );
|
||||
my $new_fields_string =
|
||||
"This is not a new error within Koha, the following new field(s) have been added to the API response: "
|
||||
. join( ', ', @new_fields_in_response )
|
||||
. '. They should be added to the API definition';
|
||||
warning_like { scalar(@new_fields_in_response) } 0, $new_fields_string;
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue