Created
June 21, 2012 20:26
-
-
Save tamias/2968321 to your computer and use it in GitHub Desktop.
Test Submit type attr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Test::More; | |
{ | |
package MyApp::Form::SubmitType; | |
use HTML::FormHandler::Moose; | |
extends 'HTML::FormHandler'; | |
has_field 'submit' => ( | |
type => 'Submit', widget => 'ButtonTag', | |
); | |
no HTML::FormHandler::Moose; | |
1; | |
} | |
{ | |
my $form = MyApp::Form::SubmitType->new; | |
ok( $form ); | |
my $rendered = $form->render; | |
like($rendered, qr/type="submit"/, | |
'Submit button has type "submit"'); | |
} | |
{ | |
my $form = MyApp::Form::SubmitType->new(is_html5 => 1); | |
ok( $form ); | |
my $rendered = $form->render; | |
like($rendered, qr/type="submit"/, | |
'Submit button has type "submit" for html5'); | |
} | |
done_testing(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment