Added tests for #encode_json