Instead of using this shared state which could cause problems with memory visibility and concurrent tests etc, how about returning the body as a string in the response body?  Then below you can do:

    response.body must_== urlencoded