/[Frey]/trunk/t/20-fey-web-row.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

Contents of /trunk/t/20-fey-web-row.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 98 - (show annotations)
Fri Jul 11 17:53:08 2008 UTC (15 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1564 byte(s)
more refactoring

Frey::Web::Row is now holder for single row from Fey::ORM
which is no longer based on Continuity::Widget (I really didn't need
attributes on widget with values, I allready had that from Fay::ORM object
which I just wrap into widget)
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 my $debug = shift @ARGV;
6
7 use Test::More tests => 20;
8 use lib 'lib';
9
10 #use Devel::LeakTrace::Fast;
11 use Data::Dump qw/dump/;
12
13 BEGIN {
14 use_ok('Frey::Web::Row');
15 }
16
17 ok( my $fey = Strix::User->new( id => 1, ime => 'foo', prezime => 'bar' ), 'Strix::User' );
18 diag dump( $fey ) if $debug;
19
20 ok( my $u = Frey::Web::Row->new( fey => $fey ), 'new' );
21 isa_ok( $u, 'Frey::Web::Row' );
22
23 diag dump( $u ) if $debug;
24
25 ok( my @c = $u->meta->get_attribute_list , 'get_attribute_list' );
26 diag dump( @c ) if $debug;
27
28 #while ( $u = $i->next ) {
29 # isa_ok( $u, 'Frey::Web::Row' );
30 #}
31
32 ok( my $h1 = $u->process(), 'process view/div' );
33 diag $h1 if $debug;
34 like( $h1, qr|<div class="view">|, 'div view' );
35
36 $u->render_as('edit');
37 ok( my $h2 = $u->process(), 'process edit/div' );
38 diag $h2 if $debug;
39 like( $h2, qr|<div class="editform">|, 'div editform' );
40
41 cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
42
43 $u->layout('table');
44 $u->render_as('view');
45 ok( $h1 = $u->process(), 'process view/table' );
46 diag $h1 if $debug;
47 like( $h1, qr|<tr>|, 'tr' );
48
49 $u->render_as('edit');
50 ok( $h2 = $u->process(), 'process edit/table' );
51 diag $h2 if $debug;
52 like( $h2, qr|<tr>|, 'tr' );
53
54 cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
55
56 $u->layout('columns');
57 $u->render_as('view');
58 ok( $h1 = $u->process(), 'process view/table' );
59 diag $h1 if $debug;
60 like( $h1, qr|<tr>|, 'tr' );
61
62 $u->render_as('edit');
63 ok( $h2 = $u->process(), 'process edit/table' );
64 diag $h2 if $debug;
65 like( $h2, qr|<tr|, 'tr' );
66
67 cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
68

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26