We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c53b66 commit 281306eCopy full SHA for 281306e
t/server/controller/author.t
@@ -2,7 +2,7 @@ use strict;
2
use warnings;
3
use lib 't/lib';
4
5
-use MetaCPAN::Server::Test qw( app GET POST test_psgi );
+use MetaCPAN::Server::Test qw( app GET POST test_psgi es );
6
use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers );
7
use Test::More;
8
@@ -56,7 +56,12 @@ test_psgi app, sub {
56
57
if ( $k eq '/author/_mapping' ) {
58
my ($index) = keys %{$json};
59
- ok( ref $json->{$index}{mappings}{author} eq 'HASH', '_mapping' );
+ my $check_mappings = $json->{$index}{mappings};
60
+ if ( es->api_version le '5_0' ) {
61
+ $check_mappings = $check_mappings->{author};
62
+ }
63
+
64
+ ok( $check_mappings->{properties}{name}, '_mapping' );
65
}
66
67
0 commit comments