Permalink
Browse files

Cleanup for release

  • Loading branch information...
gshank committed Jul 26, 2009
1 parent c5fea13 commit 162c91915cfc78cc3ab61e510a38cc6c2c76c72d
Showing with 7 additions and 11 deletions.
  1. +1 −2 MANIFEST.SKIP
  2. +1 −2 t/db_validate.t
  3. +1 −0 t/fif.t
  4. +1 −0 t/init_object.t
  5. +2 −2 t/lib/BookDB/Controller/Author.pm
  6. +1 −5 t/unique.t
View
@@ -5,12 +5,11 @@
^MANIFEST.bak$
^MANIFEST.SKIP$
.git/
+.gitignore$
^*.tar.gz$
^HTML-FormHandler-*/
^t/00create_db.t
^*.bak$
^.perltidyrc$
^*.old$
^*.new$
-^t/db/book.db$
-
View
@@ -17,7 +17,7 @@ my $bad = {
'title' => "Another Silly Test Book",
'author' => "C. Foolish",
'year' => '1590',
- 'pages' => 'too few',
+ 'pages' => '101',
};
my $book = $schema->resultset('Book')->create( $bad );
@@ -28,7 +28,6 @@ my $form = BookDB::Form::Book->new( item => $book );
ok( !$form->db_validate, 'Bad db data doesn\'t validate' );
$bad->{year} = 1999;
-$bad->{pages} = 101;
my $validated = $form->process( $bad );
ok( $validated, 'now form validates' );
View
@@ -60,6 +60,7 @@ is( $form->field('pages')->fif, 702, 'get field fif value' );
is( $form->get_param('pages'), '501', 'params contains new value' );
is( $form->field('author')->fif, 'S.Else', 'get another field fif value' );
+$form->processed(0);
my $validated = $form->process;
View
@@ -48,6 +48,7 @@ is( $author_field->value, 'Pick a Better Author', 'get init value from form' );
is( $form->field('user_updated')->value, 1, 'writeonly value not from init_obj' );
is( $form->field('publisher')->fif, 'something', 'noupdate fif from init_obj' );
+$form->processed(0); # to unset processed flag caused by fif
my $params = {
'title' => 'We Love to Test Perl Form Processors',
@@ -7,7 +7,7 @@ BEGIN {
use BookDB::Form::User;
-has 'form' => ( isa => 'BookDB::Form::Author', is => 'rw',
+has 'author_form' => ( isa => 'BookDB::Form::Author', is => 'rw',
lazy => 1, default => sub { BookDB::Form::Author->new } );
=head1 NAME
@@ -74,7 +74,7 @@ sub form
{
my ( $self, $c ) = @_;
- $c->stash( form => $self->form, template => 'author/form.tt',
+ $c->stash( form => $self->author_form, template => 'author/form.tt',
action => $c->chained_uri_for->as_string );
return unless $self->form->validate( $c->stash->{author},
params => $c->req->parameters );
View
@@ -4,7 +4,7 @@ use lib 't/lib';
BEGIN {
eval "use DBIx::Class";
plan skip_all => 'DBIX::Class required' if $@;
- plan tests => 8;
+ plan tests => 7;
}
use_ok( 'BookDB::Form::Book');
@@ -65,8 +65,4 @@ ok( ! $form2->process( $params ), 'duplicate isbn again' );
is( $errors[0], 'Duplicate ISBN number', 'field error message for duplicate');
-my $book = $schema->resultset('Book')->find(1);
-my $form3 = My::Form->new( item_id => [ $book->id ], schema => $schema );
-ok( $form3->process( $params ), 'Updating works' );
-

0 comments on commit 162c919

Please sign in to comment.