/[Frey]/trunk/t/11-strix-view-user.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/11-strix-view-user.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 96 - (show annotations)
Fri Jul 11 12:47:50 2008 UTC (15 years, 9 months ago) by dpavlin
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 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 my $debug = shift @ARGV;
6
7 use Test::More tests => 19;
8 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 ok( my $u = Strix::View::User->new( id => 1, ime => 'foo', prezime => 'bar' ), 'new' );
18 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 ok( my $h1 = $u->process(), 'process view/div' );
30 diag $h1 if $debug;
31 like( $h1, qr|<div class="view">|, 'div view' );
32
33 $u->_render_as('edit');
34 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 $u->_layout('table');
41 $u->_render_as('view');
42 ok( $h1 = $u->process(), 'process view/table' );
43 diag $h1 if $debug;
44 like( $h1, qr|<tr>|, 'tr' );
45
46 $u->_render_as('edit');
47 ok( $h2 = $u->process(), 'process edit/table' );
48 diag $h2 if $debug;
49 like( $h2, qr|<tr>|, 'tr' );
50
51 cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
52
53 $u->_layout('columns');
54 $u->_render_as('view');
55 ok( $h1 = $u->process(), 'process view/table' );
56 diag $h1 if $debug;
57 like( $h1, qr|<tr>|, 'tr' );
58
59 $u->_render_as('edit');
60 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