Add tests for hasFriends with 100% coverage.

This commit is contained in:
Colin Kuskie 2009-03-28 05:12:23 +00:00
parent 39785cf169
commit 9e1b9d2f49

View file

@ -20,7 +20,7 @@ use WebGUI::Cache;
use WebGUI::User;
use WebGUI::ProfileField;
use Test::More tests => 147; # increment this value for each test you create
use Test::More tests => 149; # increment this value for each test you create
use Test::Deep;
my $session = WebGUI::Test->session;
@ -672,6 +672,17 @@ is(
'getProfileUrl: uses session->url->page if no URL is passed in'
);
################################################################
#
# hasFriends
#
################################################################
ok(! $neighbor->hasFriends, 'hasFriends, user has no friends');
$friend->addToGroups([$neighbor->friends->getId]);
ok( $neighbor->hasFriends, 'hasFriends, user has a friend');
$friend->deleteFromGroups([$neighbor->friends->getId]);
END {
foreach my $account ($user, $dude, $buster, $buster3, $neighbor, $friend, $newFish, $newCreateUser) {
(defined $account and ref $account eq 'WebGUI::User') and $account->delete;