Remove SKIP for use_ok, and fix surveyJSON accessor.

This commit is contained in:
Colin Kuskie 2010-06-10 19:27:49 -07:00
parent 073623b366
commit fc3bda3d3b

View file

@ -19,21 +19,17 @@ my $session = WebGUI::Test->session;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Tests # Tests
my $tests = 2; plan tests => 3;
plan tests => $tests + 1;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# put your tests here # put your tests here
my $usedOk = use_ok('WebGUI::Asset::Wobject::Survey'); use_ok('WebGUI::Asset::Wobject::Survey');
my ($survey); my ($survey);
# Returns the contents of the Survey_tempReport table # Returns the contents of the Survey_tempReport table
sub getAll { $session->db->buildArrayRefOfHashRefs('select * from Survey_tempReport where assetId = ?', [$survey->getId]) } sub getAll { $session->db->buildArrayRefOfHashRefs('select * from Survey_tempReport where assetId = ?', [$survey->getId]) }
SKIP: {
skip $tests, "Unable to load Survey" unless $usedOk;
my $user = WebGUI::User->new( $session, 'new' ); my $user = WebGUI::User->new( $session, 'new' );
WebGUI::Test->addToCleanup($user); WebGUI::Test->addToCleanup($user);
my $import_node = WebGUI::Asset->getImportNode($session); my $import_node = WebGUI::Asset->getImportNode($session);
@ -42,7 +38,7 @@ my $import_node = WebGUI::Asset->getImportNode($session);
$survey = $import_node->addChild( { className => 'WebGUI::Asset::Wobject::Survey', } ); $survey = $import_node->addChild( { className => 'WebGUI::Asset::Wobject::Survey', } );
isa_ok($survey, 'WebGUI::Asset::Wobject::Survey'); isa_ok($survey, 'WebGUI::Asset::Wobject::Survey');
my $sJSON = $survey->surveyJSON; my $sJSON = $survey->getSurveyJSON;
# Load bare-bones survey, containing a single section (S0) # Load bare-bones survey, containing a single section (S0)
$sJSON->update([0], { variable => 'S0' }); $sJSON->update([0], { variable => 'S0' });
@ -128,8 +124,6 @@ superhashof({
value => 20, # e.g. score value => 20, # e.g. score
})]); })]);
}
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Cleanup # Cleanup