Guest User

Untitled

a guest
Jul 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. diff --git a/t/c/page_delete.t b/t/c/page_delete.t
  2. index 1fe5b33..725aa34 100644
  3. --- a/t/c/page_delete.t
  4. +++ b/t/c/page_delete.t
  5. @@ -2,6 +2,8 @@
  6. use strict;
  7. use warnings;
  8. use Test::More;
  9. +use lib 't/lib';
  10. +use MojoMojoTestSchema;
  11.  
  12. BEGIN{
  13. $ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
  14. @@ -14,7 +16,7 @@ BEGIN {
  15. eval "use WWW::Mechanize::TreeBuilder";
  16. plan skip_all => 'need WWW::Mechanize::TreeBuilder' if $@;
  17.  
  18. - plan tests => 18;
  19. + plan tests => 20;
  20. }
  21.  
  22. use_ok('MojoMojo::Controller::Page');
  23. @@ -35,8 +37,12 @@ ok(($elem) = $mech->look_down(
  24. _tag => 'a',
  25. 'href' => qr'/admin$'
  26. ), 'admin link');
  27. +
  28. +# Get the name of the admin user. Then test against it.
  29. +ok my $schema = MojoMojoTestSchema->get_schema, 'get the schema to get the name of admin user.';
  30. +ok my $admin_user = $schema->resultset('Person')->find({login => 'admin'}), 'get admin user Person row o
  31. if ($elem) {
  32. - is $elem->as_trimmed_text, 'admin', 'logged in as admin';
  33. + is $elem->as_trimmed_text, $admin_user->name , 'logged in as admin';
  34. }
  35.  
  36. $mech->get_ok('/.delete', 'can request delete page');
Add Comment
Please, Sign In to add comment