added role self_check and self_check_any to User store
[catagits/Catalyst-Authentication-Store-DBIx-Class.git] / t / 05-auth-roles-relationship.t
index 7b5f1c8..2d3ebf7 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( {
@@ -78,3 +74,9 @@ use Catalyst::Test 'TestApp';
     ok( my $res = request('http://localhost/user_login?username=nuffin&password=much&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=mark&password=secret&detach=is_admin'), 'request ok' );
+    is( $res->content, 'failed', 'user is not an admin' );
+}