diff options
Diffstat (limited to 't')
-rw-r--r-- | t/01_basic.t | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/t/01_basic.t b/t/01_basic.t index 630bd55..c18f862 100644 --- a/t/01_basic.t +++ b/t/01_basic.t @@ -8,20 +8,25 @@ use HTTP::Request::Common; my $handler = builder { enable "i18n"; sub { - [ '200', ['Content-Type' => 'text/html', 'Accept-Language' => 'fr'], - ['Hello world'] + my $env = shift; + [ '200', + ['Content-Type' => 'text/html',], + ['locale is ' . $env->{'psgix.locale'}] ]; }; }; test_psgi - app => $handler, - client => sub { + app => $handler, + client => sub { my $cb = shift; { my $req = GET "http://localhost/"; + $req->header('Accept-Language' => 'fr-FR,de;q=0.8'); ok my $res = $cb->($req); + is $res->content, 'locale is fr'; } -}; + }; done_testing(); + |