summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-11-23 00:15:15 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-11-23 00:15:15 +0000
commitca652e04320debad4a1a5a98dec07e46a51344c6 (patch)
tree2acbe8b75a717d32f4a809620eb0b789e15c99b8
parent523c27df90abf71c0d55a12575e4bf7b3c3a1a97 (diff)
Test case corrected to set config entry first.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2419 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--t/62-api.t3
-rw-r--r--t/data/62-request-data7
2 files changed, 9 insertions, 1 deletions
diff --git a/t/62-api.t b/t/62-api.t
index 3357a8ba..02b5dea6 100644
--- a/t/62-api.t
+++ b/t/62-api.t
@@ -35,6 +35,9 @@ my $dbh = LedgerSMB::DBTest->connect("dbi:Pg:dbname=$ENV{PGDATABASE}", undef, un
my $locale = LedgerSMB::Locale->get_handle( ${LedgerSMB::Sysconfig::language} );
for my $test (@$test_request_data){
+ if (ref $pre_test_subs->{"$test->{_test_id}"} eq 'CODE'){
+ $pre_test_subs->{"$test->{_test_id}"}();
+ }
if (lc $test->{_codebase} eq 'old'){
next; # skip old codebase tests for now
old_code_test::_load_script($test->{module});
diff --git a/t/data/62-request-data b/t/data/62-request-data
index 2cf45212..bb5e7747 100644
--- a/t/data/62-request-data
+++ b/t/data/62-request-data
@@ -95,7 +95,11 @@ our $test_request_data = [
},
];
-our $pre_test_subs = {};
+our $pre_test_subs = {
+ 'Payment print total' => sub {
+ $LedgerSMB::Sysconfig::check_max_invoices = 1;
+ },
+};
our $api_test_cases = {
'AR Transaction Voucher Screen' => sub {
my $request = shift;
@@ -121,6 +125,7 @@ our $api_test_cases = {
use strict;
my $request = shift;
$request->debug({file => '/tmp/check' });
+ cmp_ok($request->{invoice_count_25}, '>', $LedgerSMB::Sysconfig::check_max_invoices, 'Test is valid under current config');
cmp_ok(scalar @{$request->{checks}}, '==',
$request->{contact_count},
'Correct number of checks printed');