Bug 21087: Test to describe the issue
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: John Doe <you@example.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
7248191cee
commit
3d41d947d2
1 changed files with 9 additions and 1 deletions
|
@ -1427,7 +1427,7 @@ subtest 'Test Koha::Patrons::merge' => sub {
|
||||||
};
|
};
|
||||||
|
|
||||||
subtest '->store' => sub {
|
subtest '->store' => sub {
|
||||||
plan tests => 1;
|
plan tests => 3;
|
||||||
my $schema = Koha::Database->new->schema;
|
my $schema = Koha::Database->new->schema;
|
||||||
$schema->storage->txn_begin;
|
$schema->storage->txn_begin;
|
||||||
|
|
||||||
|
@ -1442,6 +1442,14 @@ subtest '->store' => sub {
|
||||||
'Koha::Exceptions::Object::DuplicateID',
|
'Koha::Exceptions::Object::DuplicateID',
|
||||||
'Koha::Patron->store raises an exception on duplicate ID';
|
'Koha::Patron->store raises an exception on duplicate ID';
|
||||||
|
|
||||||
|
# Test password
|
||||||
|
my $password = 'password';
|
||||||
|
$patron_1->password($password)->store;
|
||||||
|
like( $patron_1->password, qr|^\$2|, 'Password should be hashed using bcrypt (start with $2)' );
|
||||||
|
my $digest = $patron_1->password;
|
||||||
|
$patron_1->surname('xxx')->store;
|
||||||
|
is( $patron_1->password, $digest, 'Password should not have changed on ->store');
|
||||||
|
|
||||||
$schema->storage->dbh->{PrintError} = $print_error;
|
$schema->storage->dbh->{PrintError} = $print_error;
|
||||||
$schema->storage->txn_rollback;
|
$schema->storage->txn_rollback;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue