/[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 101 - (hide annotations)
Fri Jul 11 22:54:42 2008 UTC (15 years, 10 months ago) by dpavlin
Original Path: trunk/t/20-fey-web-row.t
File MIME type: application/x-troff
File size: 1612 byte(s)
another refactor to support multiple databases [0.09]

- Frey::ClassLoader has now saner API (I hope) and ability to load all classes
- Frey::ObjectBrowser needs also fey_class now
- only packages with rows method will now be browsable
1 dpavlin 63 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     my $debug = shift @ARGV;
6    
7 dpavlin 101 use Test::More tests => 21;
8 dpavlin 63 use lib 'lib';
9    
10     #use Devel::LeakTrace::Fast;
11     use Data::Dump qw/dump/;
12    
13     BEGIN {
14 dpavlin 98 use_ok('Frey::Web::Row');
15 dpavlin 101 use_ok('Strix::User');
16 dpavlin 63 }
17    
18 dpavlin 98 ok( my $fey = Strix::User->new( id => 1, ime => 'foo', prezime => 'bar' ), 'Strix::User' );
19     diag dump( $fey ) if $debug;
20 dpavlin 63
21 dpavlin 101 ok( my $u = Frey::Web::Row->new( fey_class => ref($fey), fey => $fey ), 'new' );
22 dpavlin 98 isa_ok( $u, 'Frey::Web::Row' );
23    
24 dpavlin 63 diag dump( $u ) if $debug;
25    
26     ok( my @c = $u->meta->get_attribute_list , 'get_attribute_list' );
27     diag dump( @c ) if $debug;
28    
29     #while ( $u = $i->next ) {
30 dpavlin 98 # isa_ok( $u, 'Frey::Web::Row' );
31 dpavlin 63 #}
32    
33 dpavlin 89 ok( my $h1 = $u->process(), 'process view/div' );
34     diag $h1 if $debug;
35     like( $h1, qr|<div class="view">|, 'div view' );
36    
37 dpavlin 98 $u->render_as('edit');
38 dpavlin 89 ok( my $h2 = $u->process(), 'process edit/div' );
39     diag $h2 if $debug;
40     like( $h2, qr|<div class="editform">|, 'div editform' );
41    
42     cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
43    
44 dpavlin 98 $u->layout('table');
45     $u->render_as('view');
46 dpavlin 95 ok( $h1 = $u->process(), 'process view/table' );
47     diag $h1 if $debug;
48     like( $h1, qr|<tr>|, 'tr' );
49 dpavlin 89
50 dpavlin 98 $u->render_as('edit');
51 dpavlin 95 ok( $h2 = $u->process(), 'process edit/table' );
52     diag $h2 if $debug;
53     like( $h2, qr|<tr>|, 'tr' );
54 dpavlin 89
55 dpavlin 95 cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
56 dpavlin 89
57 dpavlin 98 $u->layout('columns');
58     $u->render_as('view');
59 dpavlin 95 ok( $h1 = $u->process(), 'process view/table' );
60     diag $h1 if $debug;
61     like( $h1, qr|<tr>|, 'tr' );
62    
63 dpavlin 98 $u->render_as('edit');
64 dpavlin 95 ok( $h2 = $u->process(), 'process edit/table' );
65     diag $h2 if $debug;
66     like( $h2, qr|<tr|, 'tr' );
67    
68     cmp_ok( $h1, 'ne', $h2, 'view and edit differs' );
69    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26