From 73319bf6c0927cca8004ef5fe7f0f6ee2cc2692a Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 15 Jun 2010 12:40:42 -0500 Subject: [PATCH] fix copy tests being hard coded based on default home page content --- t/AssetHelper/Copy/WithChildren.t | 6 +++--- t/AssetHelper/Copy/WithDescendants.t | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/t/AssetHelper/Copy/WithChildren.t b/t/AssetHelper/Copy/WithChildren.t index 19b83b55f..44a6d4b76 100644 --- a/t/AssetHelper/Copy/WithChildren.t +++ b/t/AssetHelper/Copy/WithChildren.t @@ -42,8 +42,8 @@ my $root = WebGUI::Asset->getRoot($session); $session->user({userId => 3}); -{ - +{ + my $toBeCopied = $home->getLineage( ['self', 'descendants'] ); $output = WebGUI::AssetHelper::Copy::WithChildren->process($home); cmp_deeply( $output, @@ -54,7 +54,7 @@ $session->user({userId => 3}); ); my $clippies = $root->getLineage(["descendants"], {statesToInclude => [qw{clipboard clipboard-limbo}], returnObjects => 1,}); - is @{ $clippies }, 10, '... only copied the asset to the clipboard with children'; + is @{ $clippies }, @$toBeCopied, '... only copied the asset to the clipboard with children'; addToCleanup(@{ $clippies }); } diff --git a/t/AssetHelper/Copy/WithDescendants.t b/t/AssetHelper/Copy/WithDescendants.t index d44f394bc..1ddde5666 100644 --- a/t/AssetHelper/Copy/WithDescendants.t +++ b/t/AssetHelper/Copy/WithDescendants.t @@ -42,8 +42,8 @@ my $root = WebGUI::Asset->getRoot($session); $session->user({userId => 3}); -{ - +{ + my $toBeCopied = $home->getLineage( ['self', 'descendants'] ); $output = WebGUI::AssetHelper::Copy::WithDescendants->process($home); cmp_deeply( $output, @@ -54,7 +54,7 @@ $session->user({userId => 3}); ); my $clippies = $root->getLineage(["descendants"], {statesToInclude => [qw{clipboard clipboard-limbo}], returnObjects => 1,}); - is @{ $clippies }, 27, '... only copied the asset to the clipboard with children'; + is @{ $clippies }, @{ $toBeCopied }, '... only copied the asset to the clipboard with children'; addToCleanup(@{ $clippies }); }