Skip to content

Instantly share code, notes, and snippets.

@mash
Created June 4, 2010 01:20
Show Gist options
  • Save mash/424776 to your computer and use it in GitHub Desktop.
Save mash/424776 to your computer and use it in GitHub Desktop.
diff --git a/t/plugin_i18n.t b/t/plugin_i18n.t
index 1bbe98a..8bf8f2a 100644
--- a/t/plugin_i18n.t
+++ b/t/plugin_i18n.t
@@ -17,9 +17,10 @@ use Ark::Test 'TestApp';
$request->header( 'Accept-Language' => 'fr' );
- ok( my $response = request($request), 'Request' );
+ ok( my ($response, $c) = ctx_request($request), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->code, 200, 'Response Code' );
+ is( utf8::is_utf8($c->stash->{ body }), 1, 'loc returns utf-8 flagged' );
is( $response->content, $expected, 'Content OK' );
}
diff --git a/t/plugin_i18n/lib/TestApp/Controller/Root.pm b/t/plugin_i18n/lib/TestApp/Controller/Root.pm
index b704f08..f817f58 100644
--- a/t/plugin_i18n/lib/TestApp/Controller/Root.pm
+++ b/t/plugin_i18n/lib/TestApp/Controller/Root.pm
@@ -5,7 +5,7 @@ has '+namespace' => default => '';
sub maketext :Local :Args(1) {
my ($self, $c, $key) = @_;
- $c->res->body( $c->localize($key) );
+ $c->res->body( $c->stash->{body} = $c->localize($key) );
}
sub current_language :Local {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment