--- /dev/null
+use Web::Simple 'TestApp';
+use Test::More;
+{
+ package TestApp;
+ use JSON;
+
+ sub dispatch_request {
+ sub () {
+ response_filter {
+ [200, ['Content-Type', 'application/json'], [encode_json {%{$_[0]}}]];
+ }
+ },
+ sub (GET) {
+ { hash => 'boo' }
+ },
+ sub (POST) {
+ bless { hash => 'what' }, 'what';
+ }
+ }
+}
+
+my $res = TestApp->new->run_test_request(GET => '/?foo=bar');
+is($res->content, '{"hash":"boo"}', 'raw hashref passed to response_filter');
+
+my $res2 = TestApp->new->run_test_request(POST => '/?foo=bar');
+is($res2->content, '{"hash":"what"}', 'blessed hash gets passed to response_filter');
+
+done_testing;