Encode uri in tests to allow the hash to be processed