Lines 67-73
subtest 'outstanding_debits() tests' => sub {
Link Here
|
67 |
|
67 |
|
68 |
subtest 'add_credit() tests' => sub { |
68 |
subtest 'add_credit() tests' => sub { |
69 |
|
69 |
|
70 |
plan tests => 13; |
70 |
plan tests => 15; |
71 |
|
71 |
|
72 |
$schema->storage->txn_begin; |
72 |
$schema->storage->txn_begin; |
73 |
|
73 |
|
Lines 88-93
subtest 'add_credit() tests' => sub {
Link Here
|
88 |
description => 'Payment of 25', |
88 |
description => 'Payment of 25', |
89 |
library_id => $patron->branchcode, |
89 |
library_id => $patron->branchcode, |
90 |
note => 'not really important', |
90 |
note => 'not really important', |
|
|
91 |
type => 'payment', |
91 |
user_id => $patron->id |
92 |
user_id => $patron->id |
92 |
} |
93 |
} |
93 |
); |
94 |
); |
Lines 125-129
subtest 'add_credit() tests' => sub {
Link Here
|
125 |
is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' ); |
126 |
is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' ); |
126 |
is( $offset_2->debit_id, undef, 'No debit_id is set for credits' ); |
127 |
is( $offset_2->debit_id, undef, 'No debit_id is set for credits' ); |
127 |
|
128 |
|
|
|
129 |
my $line_3 = $account->add_credit( |
130 |
{ amount => 20, |
131 |
description => 'Manual credit applied', |
132 |
library_id => $patron->branchcode, |
133 |
user_id => $patron->id, |
134 |
type => 'forgiven' |
135 |
} |
136 |
); |
137 |
|
138 |
is( $schema->resultset('ActionLog')->count(), 2, 'Log was added' ); |
139 |
is( $schema->resultset('Statistic')->count(), 2, 'No action added to statistics, because of credit type' ); |
140 |
|
128 |
$schema->storage->txn_rollback; |
141 |
$schema->storage->txn_rollback; |
129 |
}; |
142 |
}; |
130 |
- |
|
|