my %attrs = map { $_->name => $_ } $member->parameter_attributes;
my $target;
if( $sm eq "Bar"){$target = 4; }
- elsif($sm eq "Baz"){$target = 3; }
+ elsif($sm eq "Baz"){$target = 4; }
elsif($sm eq "Foo"){$target = 5; }
Test::More::is( scalar keys %attrs, $target, "Correct # of attributes for $sm");
my $attr_num;
if($action_name =~ /Delete/){next; }
elsif($sm eq "Bar"){$attr_num = 4; }
- elsif($sm eq "Baz"){$attr_num = 2; }
+ elsif($sm eq "Baz"){$attr_num = 3; }
elsif($sm eq "Foo"){$attr_num = 3; }
Test::More::is( scalar keys %attrs, $attr_num, "Correct # of attributes for $sm");
if($attr_num != keys %attrs ){
use Moose;
extends 'DBIx::Class::Core';
-use MooseX::Types::Moose qw/ArrayRef Int/;
+use MooseX::Types::Moose qw/ArrayRef Int Bool/;
use MooseX::Types::Common::String qw/NonEmptySimpleStr/;
has 'id' => (isa => Int, is => 'ro', required => 1);
has 'name' => (isa => NonEmptySimpleStr, is => 'rw', required => 1);
+has 'bool_field' => (isa => Bool, is => 'rw', required => 0);
has 'foo_list' => (
isa => ArrayRef,
is => 'rw',
__PACKAGE__->add_columns(
id => { data_type => 'integer', size => 16, is_auto_increment => 1 },
name => { data_type => 'varchar', size => 255 },
+ bool_field => {
+ data_type => 'char',
+ size => '1',
+ is_nullable => '1'
+ }
);
__PACKAGE__->set_primary_key('id');
--- /dev/null
+use strict;
+use warnings;
+use Test::More qw(no_plan);
+use Test::WWW::Mechanize::Catalyst 'ComponentUI';
+
+my $mech = Test::WWW::Mechanize::Catalyst->new;
+$mech->get_ok('http://localhost/testmodel/baz/id/1/update');
+# print $mech->content, "\n";
+$mech->tick('r-vp-1-field-bool_field:value_string', 1);
+$mech->submit_form(button => 'r-vp-1:apply');
+$mech->content_like(qr{checked="checked"}, 'checked');
+$mech->untick('r-vp-1-field-bool_field:value_string', 1);
+$mech->submit_form(button => 'r-vp-1:apply');
+$mech->content_unlike(qr{checked="checked"}, 'should not be checked');