Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/t/c/page_delete.t b/t/c/page_delete.t
- index 1fe5b33..725aa34 100644
- --- a/t/c/page_delete.t
- +++ b/t/c/page_delete.t
- @@ -2,6 +2,8 @@
- use strict;
- use warnings;
- use Test::More;
- +use lib 't/lib';
- +use MojoMojoTestSchema;
- BEGIN{
- $ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
- @@ -14,7 +16,7 @@ BEGIN {
- eval "use WWW::Mechanize::TreeBuilder";
- plan skip_all => 'need WWW::Mechanize::TreeBuilder' if $@;
- - plan tests => 18;
- + plan tests => 20;
- }
- use_ok('MojoMojo::Controller::Page');
- @@ -35,8 +37,12 @@ ok(($elem) = $mech->look_down(
- _tag => 'a',
- 'href' => qr'/admin$'
- ), 'admin link');
- +
- +# Get the name of the admin user. Then test against it.
- +ok my $schema = MojoMojoTestSchema->get_schema, 'get the schema to get the name of admin user.';
- +ok my $admin_user = $schema->resultset('Person')->find({login => 'admin'}), 'get admin user Person row o
- if ($elem) {
- - is $elem->as_trimmed_text, 'admin', 'logged in as admin';
- + is $elem->as_trimmed_text, $admin_user->name , 'logged in as admin';
- }
- $mech->get_ok('/.delete', 'can request delete page');
Add Comment
Please, Sign In to add comment