This commit is contained in:
@@ -79,7 +79,7 @@ namespace raven_integration
|
||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
Util.ShouldContainValidationError(a, "Template", "2203");
|
||||
|
||||
//BAD AYATYPE ERROR
|
||||
//BAD AYATYPE ERROR
|
||||
d = new JObject();
|
||||
d.Id = 0;//<==ERROR NO_TYPE, INVALID
|
||||
//template, simple test, nothing fancy
|
||||
@@ -94,10 +94,31 @@ namespace raven_integration
|
||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
Util.ShouldContainValidationError(a, "ayaType", "2203");
|
||||
|
||||
//RIGHTS ISSUE,
|
||||
//currently only bizadminfull can change a picklist template
|
||||
d = new JObject();
|
||||
d.Id = 3;//User
|
||||
//template, simple test, nothing fancy
|
||||
dTemplateArray = new JArray();
|
||||
df = new JObject();
|
||||
df.fld = "useremployeenumber";
|
||||
dTemplateArray.Add(df);
|
||||
d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
|
||||
//replace the User template at the server
|
||||
//ERROR NO RIGHTS USER
|
||||
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("CustomerLimited"), d.ToString(Newtonsoft.Json.Formatting.None));
|
||||
//"{\"error\":{\"code\":\"2004\",\"message\":\"User not authorized for this resource operation (insufficient rights)\"}}"
|
||||
Util.ValidateErrorCodeResponse(a, 2004, 403);
|
||||
|
||||
//EMPTY TEMPLATE VALIDATION ERROR
|
||||
d = new JObject();
|
||||
d.Id = 3;//User
|
||||
d.Template = "";//<-- ERROR no template
|
||||
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
|
||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
Util.ShouldContainValidationError(a, "Template", "2201");
|
||||
|
||||
|
||||
//bad field name
|
||||
//no such list
|
||||
//no rights? (might need to make some changes at server, right now maybe anyone can modify template (bad))
|
||||
//empty template
|
||||
//malformed template bad json?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user