Epic cleanup and code shuffle in tests to avoid warnings
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / AuthRealmTestAppCompat / Controller / Root.pm
diff --git a/t/lib/AuthRealmTestAppCompat/Controller/Root.pm b/t/lib/AuthRealmTestAppCompat/Controller/Root.pm
new file mode 100644 (file)
index 0000000..9083896
--- /dev/null
@@ -0,0 +1,31 @@
+package AuthRealmTestAppCompat::Controller::Root;
+use warnings;
+use strict;
+use base qw/Catalyst::Controller/;
+
+__PACKAGE__->config( namespace => '' );
+
+use Test::More;
+use Test::Exception;
+
+sub moose : Local {
+       my ( $self, $c ) = @_;
+
+    while ( my ($user, $info) = each %$AuthRealmTestAppCompat::members ) {
+
+        my $ok = eval {
+            $c->authenticate(
+                { username => $user, password => $info->{password} },
+                'members'
+            ),
+        };
+
+        ok( !$@,                "Test did not die: $@" );
+        ok( $ok,                "user $user authentication" );
+    }
+
+       $c->res->body( "ok" );
+}
+
+1;
+