From f40a6908092279af711f71c9f4d8868ba096463f Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Thu, 14 Oct 2010 16:17:33 -0500 Subject: [PATCH] remove tests for deleted modules --- t/AssetHelper/Copy/WithChildren.t | 76 ------------------------ t/AssetHelper/Copy/WithDescendants.t | 76 ------------------------ t/AssetHelper/Demote.t | 89 ---------------------------- t/AssetHelper/Manage.t | 82 ------------------------- t/AssetHelper/Promote.t | 89 ---------------------------- 5 files changed, 412 deletions(-) delete mode 100644 t/AssetHelper/Copy/WithChildren.t delete mode 100644 t/AssetHelper/Copy/WithDescendants.t delete mode 100644 t/AssetHelper/Demote.t delete mode 100644 t/AssetHelper/Manage.t delete mode 100644 t/AssetHelper/Promote.t diff --git a/t/AssetHelper/Copy/WithChildren.t b/t/AssetHelper/Copy/WithChildren.t deleted file mode 100644 index 16bded1d0..000000000 --- a/t/AssetHelper/Copy/WithChildren.t +++ /dev/null @@ -1,76 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# Write a little about what this script tests. -# -# - -use strict; -use Test::More; -use Test::Deep; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; -use WebGUI::Asset; -use WebGUI::AssetHelper::Copy::WithChildren; - -#---------------------------------------------------------------------------- -# Init -my $session = WebGUI::Test->session; - - -#---------------------------------------------------------------------------- -# Tests - -plan tests => 3; # Increment this number for each test you create - -#---------------------------------------------------------------------------- -# put your tests here - -my $output; -my $home = WebGUI::Asset->getDefault($session); -my $root = WebGUI::Asset->getRoot($session); - -$session->user({userId => 3}); - -{ - my $toBeCopied = $home->getLineage( ['self', 'children'] ); - $output = WebGUI::AssetHelper::Copy::WithChildren->process($home); - cmp_deeply( - $output, - { - message => re('was copied to the clipboard with its children'), - }, - 'AssetHelper/Copy/WithChildren redirects the back to the copied asset' - ); - - my $clippies = $root->getLineage(["descendants"], {statesToInclude => [qw{clipboard clipboard-limbo}], returnObjects => 1,}); - is @{ $clippies }, @$toBeCopied, '... only copied the asset to the clipboard with children'; - WebGUI::Test->addToCleanup(@{ $clippies }); -} - -{ - $session->setting->set('skipCommitComments', 0); - - $output = WebGUI::AssetHelper::Copy::WithChildren->process($home); - cmp_deeply( - $output, - { - message => re('was copied to the clipboard with its children'), - open_tab => re('^'.$home->getUrl), - }, - 'AssetHelper/Copy/WithChildren opens a tab for commit comments' - ); - - my $clippies = $home->getAssetsInClipboard(); - WebGUI::Test->addToCleanup(@{ $clippies }); -} - -#vim:ft=perl diff --git a/t/AssetHelper/Copy/WithDescendants.t b/t/AssetHelper/Copy/WithDescendants.t deleted file mode 100644 index ff70aaf28..000000000 --- a/t/AssetHelper/Copy/WithDescendants.t +++ /dev/null @@ -1,76 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# Write a little about what this script tests. -# -# - -use strict; -use Test::More; -use Test::Deep; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; -use WebGUI::Asset; -use WebGUI::AssetHelper::Copy::WithDescendants; - -#---------------------------------------------------------------------------- -# Init -my $session = WebGUI::Test->session; - - -#---------------------------------------------------------------------------- -# Tests - -plan tests => 3; # Increment this number for each test you create - -#---------------------------------------------------------------------------- -# put your tests here - -my $output; -my $home = WebGUI::Asset->getDefault($session); -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, - { - message => re('was copied to the clipboard with all descendants'), - }, - 'AssetHelper/Copy/WithDescendants redirects the back to the copied asset' - ); - - my $clippies = $root->getLineage(["descendants"], {statesToInclude => [qw{clipboard clipboard-limbo}], returnObjects => 1,}); - is @{ $clippies }, @{ $toBeCopied }, '... only copied the asset to the clipboard with children'; - addToCleanup(@{ $clippies }); -} - -{ - $session->setting->set('skipCommitComments', 0); - - $output = WebGUI::AssetHelper::Copy::WithDescendants->process($home); - cmp_deeply( - $output, - { - message => re('was copied to the clipboard with all descendants'), - open_tab => re('^'.$home->getUrl), - }, - 'AssetHelper/Copy/WithDescendants opens a tab for commit comments' - ); - - my $clippies = $home->getAssetsInClipboard(); - addToCleanup(@{ $clippies }); -} - -#vim:ft=perl diff --git a/t/AssetHelper/Demote.t b/t/AssetHelper/Demote.t deleted file mode 100644 index 65a1efeea..000000000 --- a/t/AssetHelper/Demote.t +++ /dev/null @@ -1,89 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# Write a little about what this script tests. -# -# - -use strict; -use Test::More; -use Test::Deep; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; -use WebGUI::Asset; -use WebGUI::AssetHelper::Demote; - -#---------------------------------------------------------------------------- -# Init -my $session = WebGUI::Test->session; - - -#---------------------------------------------------------------------------- -# Tests - -plan tests => 3; # Increment this number for each test you create - -#---------------------------------------------------------------------------- -# put your tests here - -my $output; -my $home = WebGUI::Asset->getDefault($session); - -$session->user({userId => 3}); - -my $versionTag = WebGUI::VersionTag->getWorking($session); - -my $newPage = $home->addChild({ - className => 'WebGUI::Asset::Wobject::Layout', - title => 'Test page', -}, undef, undef, { skipAutoCommitWorkflows => 1, }); - -my $article1 = $newPage->addChild({ - className => 'WebGUI::Asset::Wobject::Article', - title => 'Article_1', -}, undef, undef, { skipAutoCommitWorkflows => 1, }); - -my $article2 = $newPage->addChild({ - className => 'WebGUI::Asset::Wobject::Article', - title => 'Article_2', -}, undef, undef, { skipAutoCommitWorkflows => 1, }); - -$versionTag->commit; -addToCleanup($versionTag); - -$session->user({userId => 1}); -$output = WebGUI::AssetHelper::Demote->process($article1); -cmp_deeply( - $output, - { - error => re('You do not have sufficient privileges'), - }, - 'AssetHelper/Demote checks for editing privileges' -); - -$session->user({userId => 3}); -$output = WebGUI::AssetHelper::Demote->process($article1); -cmp_deeply( - $output, - { - message => re('was demoted'), - }, - 'AssetHelper/Demote returns a message' -); - -my $assets = $newPage->getLineage(['children'], { returnObjects => 1 }); -cmp_deeply( - [ map { $_->getTitle } @{ $assets } ], - [ qw{Article_2 Article_1} ], - '... and assets were rearranged' -); - -#vim:ft=perl diff --git a/t/AssetHelper/Manage.t b/t/AssetHelper/Manage.t deleted file mode 100644 index 7ce916876..000000000 --- a/t/AssetHelper/Manage.t +++ /dev/null @@ -1,82 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# Write a little about what this script tests. -# -# - -use strict; -use Test::More; -use Test::Deep; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; -use WebGUI::Asset; -use WebGUI::AssetHelper::Manage; - -#---------------------------------------------------------------------------- -# Init -my $session = WebGUI::Test->session; - - -#---------------------------------------------------------------------------- -# Tests - -plan tests => 2; # Increment this number for each test you create - -#---------------------------------------------------------------------------- -# put your tests here - -my $output; -my $home = WebGUI::Asset->getDefault($session); - -$session->user({userId => 3}); - -my $versionTag = WebGUI::VersionTag->getWorking($session); - -my $newPage = $home->addChild({ - className => 'WebGUI::Asset::Wobject::Layout', - title => 'Test page', -}, undef, undef, { skipAutoCommitWorkflows => 1, }); - -my $article1 = $newPage->addChild({ - className => 'WebGUI::Asset::Wobject::Article', - title => 'Article_1', -}, undef, undef, { skipAutoCommitWorkflows => 1, }); - -my $article2 = $newPage->addChild({ - className => 'WebGUI::Asset::Wobject::Article', - title => 'Article_2', -}, undef, undef, { skipAutoCommitWorkflows => 1, }); - -$versionTag->commit; -addToCleanup($versionTag); - -$session->user({userId => 1}); -$output = WebGUI::AssetHelper::Manage->process($article2); -cmp_deeply( - $output, - { - error => re('You do not have sufficient privileges'), - }, - 'AssetHelper/Promote checks for editing privileges' -); - -$session->user({userId => 3}); -$output = WebGUI::AssetHelper::Manage->process($article2); -cmp_deeply( - $output, - { - open_tab => $article2->getManagerUrl, - }, - 'AssetHelper/Promote returns a message' -); - -#vim:ft=perl diff --git a/t/AssetHelper/Promote.t b/t/AssetHelper/Promote.t deleted file mode 100644 index 7a2c98567..000000000 --- a/t/AssetHelper/Promote.t +++ /dev/null @@ -1,89 +0,0 @@ -# vim:syntax=perl -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------ -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------ - -# Write a little about what this script tests. -# -# - -use strict; -use Test::More; -use Test::Deep; -use WebGUI::Test; # Must use this before any other WebGUI modules -use WebGUI::Session; -use WebGUI::Asset; -use WebGUI::AssetHelper::Promote; - -#---------------------------------------------------------------------------- -# Init -my $session = WebGUI::Test->session; - - -#---------------------------------------------------------------------------- -# Tests - -plan tests => 3; # Increment this number for each test you create - -#---------------------------------------------------------------------------- -# put your tests here - -my $output; -my $home = WebGUI::Asset->getDefault($session); - -$session->user({userId => 3}); - -my $versionTag = WebGUI::VersionTag->getWorking($session); - -my $newPage = $home->addChild({ - className => 'WebGUI::Asset::Wobject::Layout', - title => 'Test page', -}, undef, undef, { skipAutoCommitWorkflows => 1, }); - -my $article1 = $newPage->addChild({ - className => 'WebGUI::Asset::Wobject::Article', - title => 'Article_1', -}, undef, undef, { skipAutoCommitWorkflows => 1, }); - -my $article2 = $newPage->addChild({ - className => 'WebGUI::Asset::Wobject::Article', - title => 'Article_2', -}, undef, undef, { skipAutoCommitWorkflows => 1, }); - -$versionTag->commit; -addToCleanup($versionTag); - -$session->user({userId => 1}); -$output = WebGUI::AssetHelper::Promote->process($article2); -cmp_deeply( - $output, - { - error => re('You do not have sufficient privileges'), - }, - 'AssetHelper/Promote checks for editing privileges' -); - -$session->user({userId => 3}); -$output = WebGUI::AssetHelper::Promote->process($article2); -cmp_deeply( - $output, - { - message => re('was promoted'), - }, - 'AssetHelper/Promote returns a message' -); - -my $assets = $newPage->getLineage(['children'], { returnObjects => 1 }); -cmp_deeply( - [ map { $_->getTitle } @{ $assets } ], - [ qw{Article_2 Article_1} ], - '... and assets were rearranged' -); - -#vim:ft=perl