Skip to content

Commit

Permalink
Fix multibyte filename test for Mojolicious 5.78
Browse files Browse the repository at this point in the history
From Mojolicious 5.78, Mojo::Message::text() tries to decode content
with is charset and default_charset. So Test::Mojo->content_is() method
already decodes its content as 'UTF-8'. So we have to compare string
which is not encoded but decoded.
  • Loading branch information
keedi committed Mar 3, 2015
1 parent 80d8353 commit 0dfa997
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WriteMakefile(
VERSION_FROM => 'lib/Mojolicious/Plugin/RenderFile.pm',
AUTHOR => 'Viktor Turskyi <koorchik@cpan.org>',
MIN_PERL_VERSION => 5.010,
PREREQ_PM => { 'Mojolicious' => '3.90' },
PREREQ_PM => { 'Mojolicious' => '5.78' },
META_MERGE => {
resources => {
repository => 'https://github.com/koorchik/Mojolicious-Plugin-RenderFile',
Expand Down
3 changes: 2 additions & 1 deletion t/multibyte_filename.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use utf8;
use Mojo::Base -strict;

use Test::More;
Expand Down Expand Up @@ -51,7 +52,7 @@ my $t = Test::Mojo->new;

$t->get_ok("/default")
->status_is(200)
->content_is( encode_utf8 '漢字(かんじ)は、古代中国に発祥を持つ文字。' )
->content_is( '漢字(かんじ)は、古代中国に発祥を持つ文字。' )
->header_is( 'Content-Disposition' => encode_utf8 'attachment;filename="漢字.txt"' );

$t->get_ok("/filename")
Expand Down

0 comments on commit 0dfa997

Please sign in to comment.