Version 0.3
[blog.pm-common-perl-mods.git] / Common-Form-Processor-Model-RDBO / t / unique.t
blob11994ba3272af1c316efc53e3034662a89950bf2
1 use strict;
2 use Test::More tests => 3;
4 use lib 't/lib';
6 use NewDB;
7 use User;
8 use Form;
10 my $db = NewDB->new();
12 $db->init();
14 my $form = Form->new();
16 ok( $form->validate( { name => 'haha' } ) );
18 my $u = User->new( name => 'haha' );
19 $u->save();
21 ok( not defined $form->validate( { name => 'haha' } ) );
23 $form = Form->new( $u );
24 ok( $form->validate( { name => 'haha' } ) );
26 $u->delete();