View | Details | Raw Unified | Return to bug 33227
Collapse All | Expand All

(-)a/xt/api.t (-2 / +19 lines)
Lines 14-24 Link Here
14
14
15
use Modern::Perl;
15
use Modern::Perl;
16
16
17
use Test::More tests => 2;
17
use Test::More tests => 3;
18
18
19
use Test::Mojo;
19
use Test::Mojo;
20
use Data::Dumper;
20
use Data::Dumper;
21
21
22
use FindBin();
23
use IPC::Cmd qw(can_run);
24
22
my $t    = Test::Mojo->new('Koha::REST::V1');
25
my $t    = Test::Mojo->new('Koha::REST::V1');
23
my $spec = $t->get_ok( '/api/v1/', 'Correctly fetched the spec' )->tx->res->json;
26
my $spec = $t->get_ok( '/api/v1/', 'Correctly fetched the spec' )->tx->res->json;
24
27
Lines 75-77 foreach my $route ( keys %{$paths} ) { Link Here
75
78
76
is( scalar @missing_additionalProperties, 0 )
79
is( scalar @missing_additionalProperties, 0 )
77
  or diag Dumper \@missing_additionalProperties;
80
  or diag Dumper \@missing_additionalProperties;
78
- 
81
82
subtest 'The spec passes the swagger-cli validation' => sub {
83
84
    plan tests => 1;
85
86
    SKIP: {
87
        skip "Skipping tests, swagger-cli missing", 1
88
          unless can_run('swagger-cli');
89
90
        my $spec_dir = "$FindBin::Bin/../api/v1/swagger";
91
        my $var      = qx{swagger-cli validate $spec_dir/swagger.yaml 2>&1};
92
        is( $?, 0, 'Validation exit code is 0' )
93
          or diag $var;
94
    }
95
};

Return to bug 33227