/[Frey]/branches/zimbardo/t/App/RoomReservation-Reservation.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/zimbardo/t/App/RoomReservation-Reservation.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1181 - (hide annotations)
Tue Jul 7 22:07:51 2009 UTC (14 years, 10 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1104 byte(s)
 r4308@llin (orig r1175):  dpavlin | 2009-07-06 22:27:57 +0200
 adaptive length of input type=text on form using new form_value_len
 which is implemented by App class
 r4309@llin (orig r1176):  dpavlin | 2009-07-07 14:28:59 +0200
 fix revert and postpone for first file in diff
 r4310@llin (orig r1177):  dpavlin | 2009-07-07 22:11:24 +0200
 take a look at new mst toy (DBIx::Class refactoring into Moose goodness)
 r4311@llin (orig r1178):  dpavlin | 2009-07-07 22:11:44 +0200
 use number of seats from room definition
 r4312@llin (orig r1179):  dpavlin | 2009-07-07 22:12:50 +0200
 wrap title call to application class in eval (sometimes it needs instance of class)
 r4313@llin (orig r1180):  dpavlin | 2009-07-07 22:53:55 +0200
 added mime headers and charset

1 dpavlin 1086 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     my $debug = @ARGV ? 1 : 0;
6    
7 dpavlin 1181 use Test::More tests => 7;
8 dpavlin 1086 use lib 'lib';
9    
10     use Data::Dump qw/dump/;
11    
12     BEGIN {
13     use_ok('App::RoomReservation::Reservation');
14     }
15    
16 dpavlin 1104 my $r = {
17 dpavlin 1095 ime => 'Pero',
18     prezime => 'Preić',
19     institucija => 'Institut za istraživanje ruda i gubljenje vremena',
20     zanimanje => 'čuvar hladovine',
21     grad => 'Agram',
22     drzava => 'Hrvatska',
23     telefon => '01-555-555',
24     mobitel => '095-555-555',
25 dpavlin 1146 email => "test+$$\@example.com",
26     email_verify => "test+$$\@example.com",
27 dpavlin 1104 };
28    
29     ok( my $o = App::RoomReservation::Reservation->new( request_url => '/', debug => $debug, %$r ), 'new' );
30 dpavlin 1095 ok( my $markup = $o->create_as_markup, 'create' );
31 dpavlin 1086 diag $markup if $debug;
32 dpavlin 1095 #like( $markup, qr/skeleton/, 'markup content' );
33 dpavlin 1086
34 dpavlin 1160 ok( my $labels = $o->form_labels, 'form_labels' );
35     diag "labels ",dump( $labels );
36    
37 dpavlin 1181 ok( my $lens = $o->form_value_len, 'form_value_len' );
38     diag dump( $lens );
39    
40 dpavlin 1104 $r->{email_verify} = 'wrong@example.com';
41     ok( ! eval { App::RoomReservation::Reservation->new( request_url => '/', debug => $debug, %$r ) }, 'e-mail wrong' );
42     like( $@, qr/e-mail/, 'died' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26