Lines 62-68
subtest 'outstanding_debits() tests' => sub {
Link Here
|
62 |
|
62 |
|
63 |
subtest 'add_credit() tests' => sub { |
63 |
subtest 'add_credit() tests' => sub { |
64 |
|
64 |
|
65 |
plan tests => 13; |
65 |
plan tests => 15; |
66 |
|
66 |
|
67 |
$schema->storage->txn_begin; |
67 |
$schema->storage->txn_begin; |
68 |
|
68 |
|
Lines 83-88
subtest 'add_credit() tests' => sub {
Link Here
|
83 |
description => 'Payment of 25', |
83 |
description => 'Payment of 25', |
84 |
library_id => $patron->branchcode, |
84 |
library_id => $patron->branchcode, |
85 |
note => 'not really important', |
85 |
note => 'not really important', |
|
|
86 |
type => 'payment', |
86 |
user_id => $patron->id |
87 |
user_id => $patron->id |
87 |
} |
88 |
} |
88 |
); |
89 |
); |
Lines 120-124
subtest 'add_credit() tests' => sub {
Link Here
|
120 |
is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' ); |
121 |
is( $offset_2->credit_id, $line_2->id, 'No debit_id is set for credits' ); |
121 |
is( $offset_2->debit_id, undef, 'No debit_id is set for credits' ); |
122 |
is( $offset_2->debit_id, undef, 'No debit_id is set for credits' ); |
122 |
|
123 |
|
|
|
124 |
my $line_3 = $account->add_credit( |
125 |
{ amount => 20, |
126 |
description => 'Manual credit applied', |
127 |
library_id => $patron->branchcode, |
128 |
user_id => $patron->id, |
129 |
type => 'forgiven' |
130 |
} |
131 |
); |
132 |
|
133 |
is( $schema->resultset('ActionLog')->count(), 2, 'Log was added' ); |
134 |
is( $schema->resultset('Statistic')->count(), 2, 'No action added to statistics, because of credit type' ); |
135 |
|
123 |
$schema->storage->txn_rollback; |
136 |
$schema->storage->txn_rollback; |
124 |
}; |
137 |
}; |
125 |
- |
|
|