Lines 30-36
my $schema = Koha::Database->schema();
Link Here
|
30 |
use_ok('Koha::SearchEngine::Elasticsearch::Indexer'); |
30 |
use_ok('Koha::SearchEngine::Elasticsearch::Indexer'); |
31 |
|
31 |
|
32 |
subtest 'create_index() tests' => sub { |
32 |
subtest 'create_index() tests' => sub { |
33 |
plan tests => 4; |
33 |
plan tests => 5; |
34 |
my $se = Test::MockModule->new( 'Koha::SearchEngine::Elasticsearch' ); |
34 |
my $se = Test::MockModule->new( 'Koha::SearchEngine::Elasticsearch' ); |
35 |
$se->mock( 'get_elasticsearch_params', sub { |
35 |
$se->mock( 'get_elasticsearch_params', sub { |
36 |
my ($self, $sub ) = @_; |
36 |
my ($self, $sub ) = @_; |
Lines 59-65
subtest 'create_index() tests' => sub {
Link Here
|
59 |
MARC::Field->new('245', '', '', 'a' => 'Title') |
59 |
MARC::Field->new('245', '', '', 'a' => 'Title') |
60 |
); |
60 |
); |
61 |
my $records = [$marc_record]; |
61 |
my $records = [$marc_record]; |
62 |
ok($indexer->update_index([1], $records), 'Update Index'); |
62 |
|
|
|
63 |
my $response = $indexer->update_index([1], $records); |
64 |
is( $response->{errors}, 0, "no error on update_index" ); |
65 |
is( scalar(@{$response->{items}}), 1, "1 item indexed" ); |
63 |
|
66 |
|
64 |
is( |
67 |
is( |
65 |
$indexer->drop_index(), |
68 |
$indexer->drop_index(), |
66 |
- |
|
|