Bug 22828: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-02-21 16:07:23 +01:00 committed by Martin Renvoize
parent 4249b20a39
commit 76bf4dc056
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 5 additions and 2 deletions

View File

@ -30,7 +30,7 @@ my $schema = Koha::Database->schema();
use_ok('Koha::SearchEngine::Elasticsearch::Indexer');
subtest 'create_index() tests' => sub {
plan tests => 4;
plan tests => 5;
my $se = Test::MockModule->new( 'Koha::SearchEngine::Elasticsearch' );
$se->mock( 'get_elasticsearch_params', sub {
my ($self, $sub ) = @_;
@ -59,7 +59,10 @@ subtest 'create_index() tests' => sub {
MARC::Field->new('245', '', '', 'a' => 'Title')
);
my $records = [$marc_record];
ok($indexer->update_index([1], $records), 'Update Index');
my $response = $indexer->update_index([1], $records);
is( $response->{errors}, 0, "no error on update_index" );
is( scalar(@{$response->{items}}), 1, "1 item indexed" );
is(
$indexer->drop_index(),