Bugzilla – Attachment 53921 Details for
Bug 16825
Add API route for getting an item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16826: [QA Follow-up] Add 'new_status' to Swagger definition
Bug-16826-QA-Follow-up-Add-newstatus-to-Swagger-de.patch (text/plain), 2.15 KB, created by
Lari Taskula
on 2016-08-02 16:26:19 UTC
(
hide
)
Description:
Bug 16826: [QA Follow-up] Add 'new_status' to Swagger definition
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2016-08-02 16:26:19 UTC
Size:
2.15 KB
patch
obsolete
>From a0e4195622dba7ca326dc9ab1d1eaad82869b457 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <larit@student.uef.fi> >Date: Tue, 2 Aug 2016 19:13:23 +0300 >Subject: [PATCH] Bug 16826: [QA Follow-up] Add 'new_status' to Swagger > definition > >Adds missing "new_status" to item's Swagger definition. > >Also, to avoid forgotten columns in definitions, adds a test to >compare item-definition to database's items-table. > >To test: >1. Run t/db_dependent/api/v1/items.t > >https://bugs.koha-community.org/show_bug.cgi?id=16825 >--- > api/v1/definitions/item.json | 4 ++++ > t/db_dependent/api/v1/items.t | 19 ++++++++++++++++++- > 2 files changed, 22 insertions(+), 1 deletion(-) > >diff --git a/api/v1/definitions/item.json b/api/v1/definitions/item.json >index 9c43f85..2422786 100644 >--- a/api/v1/definitions/item.json >+++ b/api/v1/definitions/item.json >@@ -172,6 +172,10 @@ > "stocknumber": { > "type": ["string", "null"], > "description": "inventory number" >+ }, >+ "new_status": { >+ "type": ["string", "null"], >+ "description": "'new' value, whatever free-text information." > } > } > } >diff --git a/t/db_dependent/api/v1/items.t b/t/db_dependent/api/v1/items.t >index 0536e0f..56e76d5 100644 >--- a/t/db_dependent/api/v1/items.t >+++ b/t/db_dependent/api/v1/items.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 12; >+use Test::More tests => 13; > use Test::Mojo; > use t::lib::TestBuilder; > >@@ -34,6 +34,23 @@ use Koha::Items; > > my $builder = t::lib::TestBuilder->new(); > >+subtest 'Swagger item-definition and Koha::Item' => sub { >+ plan tests => 2; >+ >+ use_ok("Swagger2"); >+ my $swagger = Swagger2->new(C4::Context->config('intranetdir')."/api/v1/swagger.json")->expand; >+ my $api_spec = $swagger->api_spec->data; >+ >+ my $properties = $api_spec->{definitions}->{"item"}->{properties}; >+ my @columns = Koha::Item->new->_result->columns; >+ my @missing; >+ foreach my $column (@columns) { >+ push @missing, $column unless $properties->{$column}; >+ } >+ >+ is(join(', ' , @missing), "", "Item definition up-to-date with Koha::Item columns."); >+}; >+ > my $dbh = C4::Context->dbh; > $dbh->{AutoCommit} = 0; > $dbh->{RaiseError} = 1; >-- >1.9.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 16825
:
52943
|
52947
|
53035
|
53108
|
53111
|
53222
|
53837
|
53921
|
53923
|
54052
|
54686
|
54687
|
56122
|
56123
|
56124
|
56125
|
56131
|
56133
|
56290
|
56292
|
56293
|
61176
|
64275
|
65007
|
67865
|
91051
|
91061
|
91124
|
91399
|
91401
|
92639