/[Frey]/branches/no-pager/t/20-frey-web-crud.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 /branches/no-pager/t/20-frey-web-crud.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 96 - (hide annotations)
Fri Jul 11 12:47:50 2008 UTC (15 years, 10 months ago) by dpavlin
Original Path: trunk/t/11-strix-view-user.t
File MIME type: application/x-troff
File size: 1489 byte(s)
refactoring to create own Continuity::Widget [0.08]

this is incremental step, and it will change along the way...
1 dpavlin 63 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     my $debug = shift @ARGV;
6    
7 dpavlin 95 use Test::More tests => 19;
8 dpavlin 63 use lib 'lib';
9    
10     #use Devel::LeakTrace::Fast;
11     use Data::Dump qw/dump/;
12    
13     BEGIN {
14     use_ok('Strix::View::User');
15     }
16    
17 dpavlin 89 ok( my $u = Strix::View::User->new( id => 1, ime => 'foo', prezime => 'bar' ), 'new' );
18 dpavlin 63 isa_ok( $u, 'Strix::View::User' );
19    
20     diag dump( $u ) if $debug;
21    
22     ok( my @c = $u->meta->get_attribute_list , 'get_attribute_list' );
23     diag dump( @c ) if $debug;
24    
25     #while ( $u = $i->next ) {
26     # isa_ok( $u, 'Strix::View::User' );
27     #}
28    
29 dpavlin 89 ok( my $h1 = $u->process(), 'process view/div' );
30     diag $h1 if $debug;
31     like( $h1, qr|<div class="view">|, 'div view' );
32    
33 dpavlin 96 $u->_render_as('edit');
34 dpavlin 89 ok( my $h2 = $u->process(), 'process edit/div' );
35     diag $h2 if $debug;
36     like( $h2, qr|<div class="editform">|, 'div editform' );
37    
38     cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
39    
40 dpavlin 95 $u->_layout('table');
41 dpavlin 96 $u->_render_as('view');
42 dpavlin 95 ok( $h1 = $u->process(), 'process view/table' );
43     diag $h1 if $debug;
44     like( $h1, qr|<tr>|, 'tr' );
45 dpavlin 89
46 dpavlin 96 $u->_render_as('edit');
47 dpavlin 95 ok( $h2 = $u->process(), 'process edit/table' );
48     diag $h2 if $debug;
49     like( $h2, qr|<tr>|, 'tr' );
50 dpavlin 89
51 dpavlin 95 cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
52 dpavlin 89
53 dpavlin 95 $u->_layout('columns');
54 dpavlin 96 $u->_render_as('view');
55 dpavlin 95 ok( $h1 = $u->process(), 'process view/table' );
56     diag $h1 if $debug;
57     like( $h1, qr|<tr>|, 'tr' );
58    
59 dpavlin 96 $u->_render_as('edit');
60 dpavlin 95 ok( $h2 = $u->process(), 'process edit/table' );
61     diag $h2 if $debug;
62     like( $h2, qr|<tr|, 'tr' );
63    
64     cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
65    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26