summaryrefslogtreecommitdiffstats
path: root/t/complex.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-15 16:57:51 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-15 16:57:51 -0500
commitabcf38defd36cf7e25ac4b4d7e07f01d0bbd3cb1 (patch)
tree6b0c95a15270c4dbabf2b9ec66e79b2f33afe5ca /t/complex.t
parent5bd93bcd1e74bfd234d7751fcc2e9582104ad5a9 (diff)
downloadmoosex-validation-doctypes-abcf38defd36cf7e25ac4b4d7e07f01d0bbd3cb1.tar.gz
moosex-validation-doctypes-abcf38defd36cf7e25ac4b4d7e07f01d0bbd3cb1.zip
missing hashref/arrayref errors still need formatting
also, they weren't being generated at all if the data was missing altogether
Diffstat (limited to 't/complex.t')
-rw-r--r--t/complex.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/complex.t b/t/complex.t
index 04dbe60..a11ecd0 100644
--- a/t/complex.t
+++ b/t/complex.t
@@ -185,6 +185,33 @@ doctype 'Location' => {
);
ok(!$errors->has_extra_data, "no extra data");
}
+
+ {
+ my $errors = $location->validate({
+ id => '14931-FL-53',
+ name => 'My House',
+ contact => {
+ phone => '867-5309',
+ support => 'anelson@cpan.org',
+ web => URI->new('https://metacpan.org/author/ANELSON'),
+ email => 'anelson@cpan.org',
+ },
+ i18n => {
+ default_currency => 'USD',
+ default_locale => 'en',
+ available_currencies => [ 'CAD', 'EUR' ],
+ available_locales => [ 'en' ]
+ }
+ });
+ is_deeply(
+ $errors->errors,
+ {
+ location => "invalid value undef for 'location'",
+ },
+ "got the right errors"
+ );
+ ok(!$errors->has_extra_data, "no extra data");
+ }
}
done_testing;