File: author.t

package info (click to toggle)
libhtml-formhandler-model-dbic-perl 0.29-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 640 kB
  • sloc: perl: 1,873; sql: 259; makefile: 14
file content (26 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use warnings;
use Test::More;

use lib 't/lib';
use BookDB::Schema;
use_ok('BookDB::Form::Author');
my $schema = BookDB::Schema->connect('dbi:SQLite:t/db/book.db');
ok($schema, 'get db schema');
my $author = $schema->resultset('Author')->find(1);

my $form = BookDB::Form::Author->new;

ok( $form, 'form built' );

$form->process( item => $author, params => {});

my @options = $form->field('books.0.genres')->options;
is(scalar @options, 6, 'got right number of genre options' );

my @formats = $form->field('books.0.format')->options;
is(scalar @formats, 6, 'got right number of format options');

my $fif = $form->fif;

done_testing;