added role self_check and self_check_any to User store
[catagits/Catalyst-Authentication-Store-DBIx-Class.git] / t / 06-auth-roles-column.t
index a021fca..f03922b 100644 (file)
@@ -13,15 +13,11 @@ BEGIN {
         or plan skip_all =>
         "DBD::SQLite is required for this test";
 
-    eval { require DBIx::Class }
-        or plan skip_all =>
-        "DBIx::Class is required for this test";
-
     eval { require Catalyst::Plugin::Authorization::Roles }
         or plan skip_all =>
         "Catalyst::Plugin::Authorization::Roles is required for this test";
 
-    plan tests => 8;
+    plan tests => 10;
 
     use TestApp;
     TestApp->config( {
@@ -77,3 +73,9 @@ use Catalyst::Test 'TestApp';
     ok( my $res = request('http://localhost/user_login?username=joeuser&password=hackme&detach=is_admin_user'), 'request ok' );
     is( $res->content, 'failed', 'user is not an admin and a user' );
 }
+
+# test superuser role override fails (not enabled)
+{
+    ok( my $res = request('http://localhost/user_login?username=graeme&password=supersecret&detach=is_admin'), 'request ok' );
+    is( $res->content, 'failed', 'user is not an admin' );
+}