Lines 153-159
subtest 'get_effective_issuing_rule' => sub {
Link Here
|
153 |
}; |
153 |
}; |
154 |
|
154 |
|
155 |
subtest 'set_rule' => sub { |
155 |
subtest 'set_rule' => sub { |
156 |
plan tests => 3; |
156 |
plan tests => 4; |
157 |
|
157 |
|
158 |
$schema->storage->txn_begin; |
158 |
$schema->storage->txn_begin; |
159 |
|
159 |
|
Lines 205-211
subtest 'set_rule' => sub {
Link Here
|
205 |
branchcode => $branchcode, |
205 |
branchcode => $branchcode, |
206 |
categorycode => $categorycode, |
206 |
categorycode => $categorycode, |
207 |
itemtype => $itemtype, |
207 |
itemtype => $itemtype, |
208 |
rule_name => 'fine', |
208 |
rule_name => 'article_requests', |
209 |
rule_value => '', |
209 |
rule_value => '', |
210 |
} ); |
210 |
} ); |
211 |
}, 'setting fine with branch/category/itemtype succeeds' ); |
211 |
}, 'setting fine with branch/category/itemtype succeeds' ); |
Lines 300-305
subtest 'set_rule' => sub {
Link Here
|
300 |
}, qr/categorycode/, 'setting holdallowed with categorycode fails' ); |
300 |
}, qr/categorycode/, 'setting holdallowed with categorycode fails' ); |
301 |
}; |
301 |
}; |
302 |
|
302 |
|
|
|
303 |
subtest 'Call with badly formatted params' => sub { |
304 |
plan tests => 4; |
305 |
|
306 |
Koha::CirculationRules->delete; |
307 |
|
308 |
foreach my $monetary_rule ( ( 'article_request_fee', 'fine', 'overduefinescap', 'recall_overdue_fine' ) ) { |
309 |
throws_ok( |
310 |
sub { |
311 |
Koha::CirculationRules->set_rule( |
312 |
{ |
313 |
categorycode => '*', |
314 |
branchcode => '*', |
315 |
( $monetary_rule ne 'article_request_fee' ? ( itemtype => '*' ) : () ), |
316 |
rule_name => $monetary_rule, |
317 |
rule_value => '10,00', |
318 |
} |
319 |
); |
320 |
}, |
321 |
qr/decimal/, |
322 |
"setting $monetary_rule fails when passed value is not decimal" |
323 |
); |
324 |
} |
325 |
}; |
326 |
|
303 |
$schema->storage->txn_rollback; |
327 |
$schema->storage->txn_rollback; |
304 |
}; |
328 |
}; |
305 |
|
329 |
|
306 |
- |
|
|