Bug 18434: Add tests for K:SE:E::get_fixer_rules
commit437d7f62fb98ec04c4ec9753aae1e3d04bb56f51
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 12 May 2017 18:39:25 +0000 (12 15:39 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 12 Jul 2017 06:57:52 +0000 (12 08:57 +0200)
tree01d82de55eb3cc3d0aa06b97544f1e598b5e92ae
parent9800895cabade7ad8d78ff986a9a156f3962efa2
Bug 18434: Add tests for K:SE:E::get_fixer_rules

This patch tries to introduce exhaustive tests for this class method.
I didn't try to provide a regression test for the current bug per-se, but
cover the current method behaviour as much as I could.

(kidclamp) I added a quick test of _convert_marc_to_json to use the mocking here
and illuminate what the change does, before the patches this should
fail (fields are indexed in place of one another), after it should succeed (new indexed fields are appended).

A minor bug is highlighted by this new tests, I'll provide a followup for it.

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ de kohaclone
 k$ prove t/db_dependent/Koha_Elasticsearch.t
=> FAIL: The returned fixer rules are not the expected ones

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2d19a34529bc313922a085a99288e55d8634c8b6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
t/db_dependent/Koha_Elasticsearch.t