]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - t/8_auth_00_base.t
CGI::Ex 2.04
[chaz/p5-CGI-Ex] / t / 8_auth_00_base.t
index c47492c3c8d7be119a9a5f2ac6b73ffad3ff7dda..4b5cbfdef5b23d9c7311b2deaa081a40ea3c93a8 100644 (file)
@@ -7,7 +7,7 @@
 =cut
 
 use strict;
-use Test::More tests => 33;
+use Test::More tests => 35;
 
 use_ok('CGI::Ex::Auth');
 
@@ -33,7 +33,7 @@ use_ok('CGI::Ex::Auth');
     use vars qw($crypt);
     BEGIN { $crypt = crypt('123qwe', 'SS') };
     sub use_crypt { 1 }
-    sub get_pass_by_user { $crypt }
+    sub get_pass_by_user { {password => $crypt, foobar => 'baz'} }
 }
 
 my $token = Auth->new->generate_token({user => 'test', real_pass => '123qwe', use_base64 => 1});
@@ -97,6 +97,11 @@ ok(! $Auth::set_cookie, "Set_cookie was not called");
 ok($Auth::deleted_cookie, "deleted_cookie was not called");
 
 
+my $auth = Aut2->get_valid_auth({form => {%$form_good3}});
+my $data = $auth->last_auth_data;
+ok($auth && $data, "Aut2 worked again");
+ok($data->{'foobar'} eq 'baz', 'And it contained the correct value');
+
 SKIP: {
     skip("Crypt::Blowfish not found", 4) if ! eval { require Crypt::Blowfish };
 
This page took 0.024015 seconds and 4 git commands to generate.