From 773fadcffc6d1a06bd2abdd927cc6e5b68b7577e Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Wed, 11 Aug 2010 23:24:28 -0400 Subject: [PATCH] Pass empty JSON for icalFeeds field in Calendar until I can get good sample data; makes Calendar Test::Asset tests pass. --- t/tests/Test/WebGUI/Asset.pm | 15 ++++++++------- t/tests/Test/WebGUI/Asset/Wobject/Calendar.pm | 8 ++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/t/tests/Test/WebGUI/Asset.pm b/t/tests/Test/WebGUI/Asset.pm index 16c5aaf45..241beb566 100644 --- a/t/tests/Test/WebGUI/Asset.pm +++ b/t/tests/Test/WebGUI/Asset.pm @@ -21,6 +21,8 @@ use WebGUI::Test; use WebGUI::Utility; use Data::Dumper; +# XXXX fix the Test(n) numbers to match reality + sub constructorExtras { return; } @@ -458,6 +460,8 @@ sub t_11_getEditForm : Tests { my $session = $test->session; my ( $tag, $asset, @parents ) = $test->getAnchoredAsset(); +local $SIG{__DIE__} = sub { use Carp; Carp::confess "@_"; }; + my $f = $asset->getEditForm; # XXX "Attribute (name) is required" / CLASS WebGUI::Asset::Wobject::Poll... fixed, now it's something else: not ok 2105 - t_11_getEditForm died (Can't locate object method "raw" via package "WebGUI::FormBuilder::Tab" at /data/WebGUI/lib/WebGUI/Asset/Wobject/Poll.pm line 292.) isa_ok( $f, 'WebGUI::FormBuilder' ); @@ -544,19 +548,16 @@ sub t_20_www_editSave : Tests { # $tag = WebGUI::VersionTag->create($session, {}); $tag->setWorking; # XXXXXX sleep 2; # also XXXX - # warn "XXX formProperties: " . Dumper [ formProperties($asset) ]; - my %mergedProperties = ( formProperties($asset), title => "Newly Saved Title", ); - if( exists $mergedProperties{attachmentsJson} and ! defined $mergedProperties{attachmentsJson} ) { - # XXX move this to the Test::WebGUI::Asset::Template subclass... maybe make a postProcessMergedProperties method - $mergedProperties{attachmentsJson} = '[{"url":"/webgui.css","type":"stylesheet"}]'; - } + $test->postProcessMergedProperties(\%mergedProperties); -local $SIG{__DIE__} = sub { use Carp; Carp::confess "@_"; }; + warn "XXX mergedProperties: " . Dumper \%mergedProperties; + +# local $SIG{__DIE__} = sub { use Carp; Carp::confess "@_"; }; $session->request->setup_body( \%mergedProperties ); diff --git a/t/tests/Test/WebGUI/Asset/Wobject/Calendar.pm b/t/tests/Test/WebGUI/Asset/Wobject/Calendar.pm index 1d068f5b0..281a8c9c3 100644 --- a/t/tests/Test/WebGUI/Asset/Wobject/Calendar.pm +++ b/t/tests/Test/WebGUI/Asset/Wobject/Calendar.pm @@ -9,6 +9,8 @@ package Test::WebGUI::Asset::Wobject::Calendar; # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- +use strict; +use warnings; use base qw/Test::WebGUI::Asset::Wobject/; @@ -21,4 +23,10 @@ sub list_of_tables { return [qw/assetData wobject Calendar/]; } +sub postProcessMergedProperties { + my $test = shift; + my $properties = shift; + $properties->{icalFeeds} = q{[]}; # XXX get some real data to stick in there +} + 1;