Revision 174 (by dpavlin, 2008/06/16 16:48:16) big rename of StrixSite to StrixInstance, added sitemap and layout

rename creates huge diff, which is rather unfortunate, but we needed
to get terminology stright: sites are part of strix instances
#!/usr/bin/env perl
use warnings;
use strict;

=head1 DESCRIPTION

A (very) basic test harness for the StrixSQL action.

=cut

use Jifty::Test tests => 10;

# Make sure we can load the action
use_ok('A3C::Action::StrixSQL');

my $action = Jifty::Test->web->new_action(
	class        => 'StrixSQL',
#	current_user => $system_user,
#	arguments    => {}
);

isa_ok( $action, 'A3C::Action::StrixSQL' );

$action->argument_values({ instance => 'os-test0604-zg', sql => 'select now() as time' });
$action->run;

ok( $action->result->success, 'result is success' );

ok( my $coll = $action->result->content( 'sql' ), 'result content have sql' );

isa_ok( $coll, 'A3C::SQL' );

cmp_ok( $coll->count, '>', 0, 'count' );

is_deeply( [ $coll->_column_names ], [ 'time' ], '_column_names' );

ok( my $row = $coll->next, 'next' );

isa_ok( $row, 'A3C::SQL::row' );

ok( my $time = $row->time, 'row->time' );

diag $time;