Lines 32-38
my $builder = t::lib::TestBuilder->new;
Link Here
|
32 |
|
32 |
|
33 |
subtest 'add_credit() tests' => sub { |
33 |
subtest 'add_credit() tests' => sub { |
34 |
|
34 |
|
35 |
plan tests => 13; |
35 |
plan tests => 15; |
36 |
|
36 |
|
37 |
$schema->storage->txn_begin; |
37 |
$schema->storage->txn_begin; |
38 |
|
38 |
|
Lines 53-58
subtest 'add_credit() tests' => sub {
Link Here
|
53 |
description => 'Payment of 25', |
53 |
description => 'Payment of 25', |
54 |
library_id => $patron->branchcode, |
54 |
library_id => $patron->branchcode, |
55 |
note => 'not really important', |
55 |
note => 'not really important', |
|
|
56 |
type => 'payment', |
56 |
user_id => $patron->id |
57 |
user_id => $patron->id |
57 |
} |
58 |
} |
58 |
); |
59 |
); |
Lines 90-94
subtest 'add_credit() tests' => sub {
Link Here
|
90 |
is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' ); |
91 |
is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' ); |
91 |
is( $offset_2->debit_id, undef, 'No debit_id is set for credits' ); |
92 |
is( $offset_2->debit_id, undef, 'No debit_id is set for credits' ); |
92 |
|
93 |
|
|
|
94 |
my $line_3 = $account->add_credit( |
95 |
{ amount => 20, |
96 |
description => 'Manual credit applied', |
97 |
library_id => $patron->branchcode, |
98 |
user_id => $patron->id, |
99 |
type => 'forgiven' |
100 |
} |
101 |
); |
102 |
|
103 |
is( $schema->resultset('ActionLog')->count(), 2, 'Log was added' ); |
104 |
is( $schema->resultset('Statistic')->count(), 2, 'No action added to statistics, because of credit type' ); |
105 |
|
93 |
$schema->storage->txn_rollback; |
106 |
$schema->storage->txn_rollback; |
94 |
}; |
107 |
}; |
95 |
- |
|
|