--- t/00-model-StrixSite.t 2008/06/03 19:31:36 151 +++ t/00-model-StrixInstance.t 2008/06/16 16:48:16 174 @@ -4,33 +4,33 @@ =head1 DESCRIPTION -A basic test harness for the StrixSite model. +A basic test harness for the StrixInstance model. =cut use Jifty::Test tests => 11; # Make sure we can load the model -use_ok('A3C::Model::StrixSite'); +use_ok('A3C::Model::StrixInstance'); # Grab a system user my $system_user = A3C::CurrentUser->superuser; ok($system_user, "Found a system user"); # Try testing a create -my $o = A3C::Model::StrixSite->new(current_user => $system_user); -my ($id) = $o->create( site => 'foo', _dbserver => 'localhost', _dbname => 'foo' ); -ok($id, "StrixSite create returned success"); -ok($o->id, "New StrixSite has valid id set"); +my $o = A3C::Model::StrixInstance->new(current_user => $system_user); +my ($id) = $o->create( instance => 'foo', _dbserver => 'localhost', _dbname => 'foo' ); +ok($id, "StrixInstance create returned success"); +ok($o->id, "New StrixInstance has valid id set"); is($o->id, $id, "Create returned the right id"); # And another -$o->create( site => 'bar', _dbserver => 'localhost', _dbname => 'bar' ); -ok($o->id, "StrixSite create returned another value"); +$o->create( instance => 'bar', _dbserver => 'localhost', _dbname => 'bar' ); +ok($o->id, "StrixInstance create returned another value"); isnt($o->id, $id, "And it is different from the previous one"); # Searches in general -my $collection = A3C::Model::StrixSiteCollection->new(current_user => $system_user); +my $collection = A3C::Model::StrixInstanceCollection->new(current_user => $system_user); $collection->unlimit; is($collection->count, 2, "Finds two records");