Skip to content

Commit

Permalink
fixed small text_area bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 10, 2012
1 parent b7f3c1d commit 02a4afc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/TagHelpers.pm
Expand Up @@ -242,7 +242,7 @@ sub register {
}

# Make sure value is wrapped
if (defined($value = $c->param($name) || $value)) {
if (defined($value = $c->param($name) // $value)) {
$cb = sub { xml_escape $value}
}

Expand Down
12 changes: 10 additions & 2 deletions t/mojolicious/tag_helper_lite_app.t
Expand Up @@ -8,7 +8,7 @@ BEGIN {
$ENV{MOJO_IOWATCHER} = 'Mojo::IOWatcher';
}

use Test::More tests => 60;
use Test::More tests => 63;

# "Hey! Bite my glorious golden ass!"
use Mojolicious::Lite;
Expand Down Expand Up @@ -332,14 +332,22 @@ $t->patch_ok('/☃')->status_is(200)->content_is(<<'EOF');
</form>
EOF

# PATCH /☃
# PATCH /☃ (form value)
$t->patch_ok('/☃?foo=ba<z')->status_is(200)->content_is(<<'EOF');
<form action="/%E2%98%83">
<textarea cols="40" name="foo">ba&lt;z</textarea>
<input type="submit" value="☃" />
</form>
EOF

# PATCH /☃ (empty form value)
$t->patch_ok('/☃?foo=')->status_is(200)->content_is(<<'EOF');
<form action="/%E2%98%83">
<textarea cols="40" name="foo"></textarea>
<input type="submit" value="☃" />
</form>
EOF

__DATA__
@@ tags.html.ep
<%= tag 'foo' %>
Expand Down

0 comments on commit 02a4afc

Please sign in to comment.