Added the export method.

Basic tests for the export method.  Need to check the CSV file
to make sure it's created correctly.
This commit is contained in:
Colin Kuskie 2008-02-16 17:11:10 +00:00
parent c3e9e5f5c3
commit 6415b9186f
2 changed files with 41 additions and 1 deletions

View file

@ -28,7 +28,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 24;
my $tests = 27;
plan tests => 1 + $tests;
#----------------------------------------------------------------------------
@ -36,6 +36,8 @@ plan tests => 1 + $tests;
my $loaded = use_ok('WebGUI::Shop::Tax');
my $storage;
SKIP: {
skip 'Unable to load module WebGUI::Shop::Tax', $tests unless $loaded;
@ -188,6 +190,17 @@ $taxIterator = $taxer->getItems;
is($taxIterator->rows, 1, 'No rows were deleted from the table since the requested id does not exist');
is($taxIterator->hashRef->{taxId}, $wisconsinTaxId, 'The correct tax information was deleted');
#######################################################################
#
# export
#
#######################################################################
$storage = $taxer->export();
isa_ok($storage, 'WebGUI::Storage', 'export returns a WebGUI::Storage object');
is($storage->{_part1}, 'temp', 'The storage object is in the temporary area');
ok(-e $storage->getPath('siteTaxData.csv'), 'siteTaxData.csv file exists in the storage object');
}
@ -195,4 +208,5 @@ is($taxIterator->hashRef->{taxId}, $wisconsinTaxId, 'The correct tax information
# Cleanup
END {
$session->db->write('delete from tax');
$storage->delete;
}