/[Frey]/trunk/t/20-html.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/20-html.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 23 - (hide annotations)
Sun Jun 29 16:24:41 2008 UTC (15 years, 11 months ago) by dpavlin
File MIME type: application/x-troff
File size: 795 byte(s)
another major refactor and version bump [0.01]

- return 404 errors for resources which doesn't exist
- move HTML page wrapper is now in Fray::HTML->page
- dispatch to defined Template::Declare templates
- display available templates on status screen
- NOTE very clean and unobfuscated mapping
- a bits of documentation all over the place
1 dpavlin 14 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5 dpavlin 23 use Test::More tests => 9;
6 dpavlin 14 use lib 'lib';
7    
8     #use Devel::LeakTrace::Fast;
9     use Data::Dump qw/dump/;
10    
11     BEGIN {
12 dpavlin 23 use_ok('Frey::HTML');
13 dpavlin 14 use_ok('Strix::User');
14     }
15    
16 dpavlin 23 $Frey::HTML::debug = 1 if @ARGV;
17     my $debug = $Frey::HTML::debug;
18 dpavlin 14
19 dpavlin 23 ok( my $h1 = Frey::HTML->page( 'status' ), 'status' );
20 dpavlin 14 diag $h1 if $debug;
21    
22 dpavlin 23 ok( Frey::HTML->add_javascript('static/jquery-1.2.6.js'), 'add_javascript' );
23 dpavlin 14
24 dpavlin 23 ok( my $h2 = Frey::HTML->page( 'status' ), 'status' );
25 dpavlin 14 diag $h2 if $debug;
26    
27 dpavlin 23 cmp_ok( length( $h1 . '' ), '<', length( $h2 . '' ), 'bigger with javascript' );
28    
29     ok( my $u = Strix::User->new( id => 1 ), 'Strix::User->new' );
30     isa_ok( $u, 'Strix::User' );
31    
32     ok( my $h3 = Frey::HTML->page( 'user' => $u ), 'user' );
33     diag $h3 if $debug;
34    
35     print Frey::HTML->page( 'status' ) if $debug;

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26