Skip to content
Permalink
Browse files

Fixes to Survey tests and merged code from 7.10

  • Loading branch information...
perlDreamer committed Jan 18, 2012
1 parent 1ab73e2 commit a6e1adf183ba2286c85216074ce1eb2c1dd231a8
Showing with 9 additions and 4 deletions.
  1. +5 −0 docs/migration.txt
  2. +2 −2 lib/WebGUI/Asset/Wobject/Survey.pm
  3. +2 −2 t/Asset/Wobject/Survey/package.t
@@ -422,3 +422,8 @@ getEditForm now returns a WebGUI::FormBuilder object
Show Performance Indicators
==========================
This setting is removed, as the Plack debug console shows this for us.

WebGUI::Asset::Wobject::Survey
==========================
The surveyJSON method conflicted with the new Moose accessor. In WebGUI 8,
the old surveyJSON is called getSurveyJSON.
@@ -2439,8 +2439,8 @@ Extend the base method to include custom question types added to this Survey.
sub exportAssetData {
my $self = shift;
my $asset_data = $self->SUPER::exportAssetData();
my $questions = $self->surveyJSON->questions();
my $multiple_choice = $self->surveyJSON->multipleChoiceTypes();
my $questions = $self->getSurveyJSON->questions();
my $multiple_choice = $self->getSurveyJSON->multipleChoiceTypes();
my %question_types = ();
my $get_question = $self->session->db->prepare('select answers from Survey_questionTypes where questionType=?');
foreach my $question (@{ $questions }) {
@@ -27,7 +27,7 @@ my $import_node = WebGUI::Asset->getImportNode($session);
my $survey = $import_node->addChild( { className => 'WebGUI::Asset::Wobject::Survey', } );
WebGUI::Test->addToCleanup($survey);

my $sJSON = $survey->surveyJSON;
my $sJSON = $survey->getSurveyJSON;

# Load bare-bones survey, containing a single section (S0)
$sJSON->update([0], { variable => 'S0' });
@@ -57,7 +57,7 @@ $asset_data->{question_types}->{fingers} = clone $asset_data->{question_types}->
$survey->importAssetCollateralData($asset_data);

$survey = $survey->cloneFromDb;
my $multipleChoiceTypes = $survey->surveyJSON->multipleChoiceTypes;
my $multipleChoiceTypes = $survey->getSurveyJSON->multipleChoiceTypes;

ok exists $multipleChoiceTypes->{fingers}, 'fingers type imported as package collateral data';
ok exists $multipleChoiceTypes->{toes}, 'still have toes, too';

0 comments on commit a6e1adf

Please sign in to comment.
You can’t perform that action at this time.