Bug 19985: Make TestBuilder.t pass even if default_circ_rules is not empty

This table cannot contain more than 1 row, so we need to remove its data
before trying to generate a new entry.

Test plan:
Set a default circ rule
 prove t/db_dependent/TestBuilder.t
should return green

Without this patch you get:
    #   Failed test 'TestBuilder should be able to create an object for every source'
    #   at t/db_dependent/TestBuilder.t line 78.
    #          got: '1'
    #     expected: '0'
    # The following sources have not been generated correctly: DefaultCircRule
    # Looks like you failed 1 test of 1.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2018-01-22 17:18:59 -03:00 committed by Nick Clemens
parent e1a61134eb
commit 55d8ea59e7
1 changed files with 1 additions and 0 deletions

View File

@ -34,6 +34,7 @@ our $schema = Koha::Database->new->schema;
$schema->storage->txn_begin;
our $builder;
$schema->resultset('DefaultCircRule')->delete; # Is a singleton table
subtest 'Start with some trivial tests' => sub {
plan tests => 7;