/[Frey]/trunk/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

Diff of /trunk/t/20-frey-web-crud.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/t/11-strix-view-user.t revision 89 by dpavlin, Thu Jul 10 20:00:54 2008 UTC trunk/t/20-fey-web-row.t revision 101 by dpavlin, Fri Jul 11 22:54:42 2008 UTC
# Line 4  use warnings; Line 4  use warnings;
4    
5  my $debug = shift @ARGV;  my $debug = shift @ARGV;
6    
7  use Test::More tests => 14;  use Test::More tests => 21;
8  use lib 'lib';  use lib 'lib';
9    
10  #use Devel::LeakTrace::Fast;  #use Devel::LeakTrace::Fast;
11  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
12    
13  BEGIN {  BEGIN {
14          use_ok('Strix::View::User');          use_ok('Frey::Web::Row');
15            use_ok('Strix::User');
16  }  }
17    
18  ok( my $u = Strix::View::User->new( id => 1, ime => 'foo', prezime => 'bar' ), 'new' );  ok( my $fey = Strix::User->new( id => 1, ime => 'foo', prezime => 'bar' ), 'Strix::User' );
19  isa_ok( $u, 'Strix::View::User' );  diag dump( $fey ) if $debug;
20    
21    ok( my $u = Frey::Web::Row->new( fey_class => ref($fey), fey => $fey ), 'new' );
22    isa_ok( $u, 'Frey::Web::Row' );
23    
24  diag dump( $u ) if $debug;  diag dump( $u ) if $debug;
25    
# Line 23  ok( my @c = $u->meta->get_attribute_list Line 27  ok( my @c = $u->meta->get_attribute_list
27  diag dump( @c ) if $debug;  diag dump( @c ) if $debug;
28    
29  #while ( $u = $i->next ) {  #while ( $u = $i->next ) {
30  #       isa_ok( $u, 'Strix::View::User' );  #       isa_ok( $u, 'Frey::Web::Row' );
31  #}  #}
32    
33  ok( my $h1 = $u->process(), 'process view/div' );  ok( my $h1 = $u->process(), 'process view/div' );
# Line 37  like( $h2, qr|<div class="editform">|, ' Line 41  like( $h2, qr|<div class="editform">|, '
41    
42  cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );  cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
43    
44    $u->layout('table');
45    $u->render_as('view');
46    ok( $h1 = $u->process(), 'process view/table' );
47    diag $h1 if $debug;
48    like( $h1, qr|<tr>|, 'tr' );
49    
50    $u->render_as('edit');
51    ok( $h2 = $u->process(), 'process edit/table' );
52    diag $h2 if $debug;
53    like( $h2, qr|<tr>|, 'tr' );
54    
55    cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
56    
57    $u->layout('columns');
58  $u->render_as('view');  $u->render_as('view');
59  $u->_layout('table');  ok( $h1 = $u->process(), 'process view/table' );
60  ok( my $h3 = $u->process(), 'process view/table' );  diag $h1 if $debug;
61  diag $h3 if $debug;  like( $h1, qr|<tr>|, 'tr' );
 like( $h3, qr|<tr>|, 'tr' );  
62    
63  $u->render_as('edit');  $u->render_as('edit');
64  ok( my $h4 = $u->process(), 'process edit/table' );  ok( $h2 = $u->process(), 'process edit/table' );
65  diag $h4 if $debug;  diag $h2 if $debug;
66  like( $h4, qr|<tr>|, 'tr' );  like( $h2, qr|<tr|, 'tr' );
67    
68  cmp_ok( $h3, 'ne', $h4, 'view and edit differs' );  cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
69    

Legend:
Removed from v.89  
changed lines
  Added in v.101

  ViewVC Help
Powered by ViewVC 1.1.26