Bug 42581: Exclude plugins' routes from xt/api.t
If some plugins are installed and inject REST API routes, xt/api.t may fail. Test plan: You can install the Jump plugin (https://gitlab.com/joubu/koha-plugin-jump) and run xt/api.t It will fail: ``` get /contrib/jump/parse -> uses tag 'parse' not present in top level list get /contrib/jump/search -> uses tag 'search' not present in top level list get /contrib/jump/search -> uses tag 'objects' not present in top level list get /contrib/jump/static/static_files/commandPalette.js -> uses tag 'Jump' not present in top level list get /contrib/jump/static/static_files/jump.css -> uses tag 'Jump' not present in top level list [...] ``` Apply this patch and run `prove xt/api.t` again => It should pass Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
4da822b6a1
commit
e109e09ae4
1
xt/api.t
1
xt/api.t
|
|
@ -33,6 +33,7 @@ my $t = Test::Mojo->new('Koha::REST::V1');
|
|||
my $spec = $t->get_ok( '/api/v1/', 'Correctly fetched the spec' )->tx->res->json;
|
||||
|
||||
my $paths = $spec->{paths};
|
||||
delete @{$paths}{ grep { m{^/contrib/} } keys %$paths }; # Skip routes injected by plugins
|
||||
|
||||
my @missing_additionalProperties = ();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue