'The return value of the decorated function is I{JSON} encoded and the
result is written as the response body.'

@validateLogging(_assertRequestLogged('/foo/bar'))
def test_encode(self, logger):

    objects = {'foo': 'bar', 'baz': ['quux']}
    request = dummyRequest('GET', '/foo/bar', Headers(), '')
    self.render(self.application(logger, objects).app.resource(), request)
    self.assertEqual(objects, loads(request._responseBody))
