Add runtime configuration to perl lib
[blerg.git] / lib / perl / Blerg-Database / t / auth.t
index e932cc4..2977409 100644 (file)
@@ -2,7 +2,7 @@ use File::Path qw/remove_tree/;
 use strict;
 use warnings;
 
-use Test::More tests => 17;
+use Test::More tests => 21;
 BEGIN { use_ok('Blerg::Database') };
 
 ### Setup
@@ -49,9 +49,19 @@ ok( not defined $token );
 isnt( Blerg::Database::auth_logout($test_user, 'badtoken'), 1 );
 isnt( Blerg::Database::auth_logout('fakeuser', 'badtoken'), 1 );
 
+my $counter1 = Blerg::Database::auth_get_counter('fakeuser');
+ok( !defined $counter1 );
+
+$counter1 = Blerg::Database::auth_get_counter($test_user);
+ok( defined $counter1 );
+isnt( $counter1, 0);
+
 Blerg::Database::auth_set_password($test_user, $password . 'X');
 ok( Blerg::Database::auth_check_password($test_user, $password . 'X') );
 
+my $counter2 = Blerg::Database::auth_get_counter($test_user);
+ok( $counter1 != $counter2 );
+
 END {
        chdir;
        remove_tree "/tmp/blerg_test_$$";