Details
-
Type:
Task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: 1.3.7
-
Fix Version/s: None
-
Component/s: Testing
-
Labels:
-
Environment:Windows XP
Description
I have to perform Integration test on a Controller, where an action signIn() defines a JSON Object as:
<< def jsonObj = request.JSON; >>
How do I pass a JSON Object in request.JSON from my controllerTests file?
I tried the following but it ain't working:
...
JSONObject jsonObj = new JSONObject();
jsonObj.put("user", createUserJsonObj());
controller.request.parameters['user'] = jsonObj
controller.signIn()
...
private JSONObject createUserJsonObj() {
JSONObject json = new JSONObject();
json.put("id", "id01");
json.put("displayName", "Test Display Name..");
return json;
}
Please ask usage questions on the User mailing list