Tag the old version before converting to the new auth. Convert to new auth, add live...
[catagits/Catalyst-Authentication-Store-Htpasswd.git] / t / backend.t
index 2eb77ca..aa0f6e9 100644 (file)
@@ -3,12 +3,11 @@
 use strict;
 use warnings;
 
-use Test::More 'no_plan';
-use Path::Class;
+use Test::More tests => 19;
 
 use File::Temp qw/tempfile/;
 
-my $m; BEGIN { use_ok($m = "Catalyst::Plugin::Authentication::Store::Htpasswd::Backend") }
+my $m; BEGIN { use_ok($m = "Catalyst::Authentication::Store::Htpasswd") }
 
 (undef, my $tmp) = tempfile();
 
@@ -16,20 +15,18 @@ my $passwd = Authen::Htpasswd->new($tmp);
 
 $passwd->add_user("user", "s3cr3t");
 
-
 can_ok($m, "new");
-isa_ok(my $o = $m->new( $passwd ), $m);
+isa_ok(my $o = $m->new( { file => $passwd } ), $m);
 
 can_ok($m, "file");
 isa_ok( $o->file, "Authen::Htpasswd");
 
-
 can_ok( $m, "user_supports");
 ok( $m->user_supports(qw/password self_check/), "user_supports self check" );
 
-can_ok($m, "get_user");
-isa_ok( my $u = $o->get_user("user"), "Catalyst::Plugin::Authentication::Store::Htpasswd::User");
-isa_ok( $u, "Catalyst::Plugin::Authentication::User");
+can_ok($m, "find_user");
+isa_ok( my $u = $o->find_user({ username => "user"}), "Catalyst::Authentication::Store::Htpasswd::User");
+isa_ok( $u, "Catalyst::Authentication::User");
 
 can_ok( $u, "supports");
 ok( $u->supports(qw/password self_check/), "htpasswd users check their own passwords");
@@ -37,7 +34,6 @@ ok( $u->supports(qw/password self_check/), "htpasswd users check their own passw
 can_ok( $u, "check_password");
 ok( $u->check_password( "s3cr3t" ), "password is s3cr3t");
 
-
 ok( $m->user_supports(qw/session/), "user_supports session");
 
 is( $u->store, $o, "can get store");