add test for logged-in user

This commit is contained in:
Doug Bell 2010-06-22 15:25:40 -04:00
parent 3010e79b0e
commit 3c0a6aa22f

View file

@ -52,7 +52,7 @@ package main;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Tests # Tests
plan tests => 6; # Increment this number for each test you create plan tests => 7; # Increment this number for each test you create
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Test the getInstance method # Test the getInstance method
@ -78,8 +78,17 @@ isa_ok(
'AuthType in config file, so return instance of authType', 'AuthType in config file, so return instance of authType',
); );
$session->user({ userId => 3 });
isa_ok(
WebGUI::Operation::Auth::getInstance( $session ),
'WebGUI::Auth::WebGUI',
'AuthType is defined by the logged-in user',
);
#----------------------------------------------------------------------------
# Test the web method for auth operation # Test the web method for auth operation
# First a clean session, without an authenticated user # First a clean session, without an authenticated user
$session->user({ userId => 1 });
my $output = WebGUI::Operation::Auth::www_auth($session); my $output = WebGUI::Operation::Auth::www_auth($session);
like( like(
$output, $output,