This commit is contained in:
@@ -69,23 +69,23 @@ namespace raven_integration
|
||||
|
||||
//RETRIEVE
|
||||
//Get the current one (server will create if non-existent)
|
||||
ApiResponse a = await Util.GetAsync("FormCustom/User", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("form-custom/User", await Util.GetTokenAsync("BizAdminFull"));
|
||||
|
||||
//Update
|
||||
d.concurrency = a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
a = await Util.PutAsync("FormCustom/User", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
a = await Util.PutAsync("form-custom/User", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
//check the concurrency token cache scheme
|
||||
uint token = a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
//This should return a 304 not modified
|
||||
a = await Util.GetAsync($"FormCustom/User?concurrency={token}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.GetAsync($"form-custom/User?concurrency={token}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 304);
|
||||
|
||||
//and this should return the whole object
|
||||
token--;//make the token not match
|
||||
//This should return a 200 and the whole object
|
||||
a = await Util.GetAsync($"FormCustom/User?concurrency={token}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.GetAsync($"form-custom/User?concurrency={token}", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
}
|
||||
|
||||
@@ -153,11 +153,11 @@ namespace raven_integration
|
||||
|
||||
//RETRIEVE
|
||||
//Get the current one (server will create if non-existent)
|
||||
ApiResponse a = await Util.GetAsync("FormCustom/User", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("form-custom/User", await Util.GetTokenAsync("BizAdminFull"));
|
||||
|
||||
//Update
|
||||
d.concurrency = a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
a = await Util.PutAsync("FormCustom/User", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
a = await Util.PutAsync("form-custom/User", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
Util.ValidateHTTPStatusCode(a, 400);
|
||||
Util.ShouldContainValidationError(a, "Template", "2201", "Template array item 0, \"fld\" property exists but is empty, a value is required");
|
||||
Util.ShouldContainValidationError(a, "Template", "2203", "Template array item 0, fld property value \"\" is not a valid form field value for formKey specified");
|
||||
@@ -189,7 +189,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void InvalidObjectFieldsFormKeyShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("FormFieldsDefinitions/nonexistent", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("form-field-definition/nonexistent", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateErrorCodeResponse(a, 2010, 404);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void ObjectFieldsWorks()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("FormFieldsDefinitions/Widget", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("form-field-definition/Widget", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(25);
|
||||
}
|
||||
@@ -212,7 +212,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void AvailableCustomizableFormKeysWorks()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("FormCustom/AvailableCustomizableFormKeys", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("form-custom/availablecustomizableformkeys", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(1);//is 2 as of writing (widget,user)
|
||||
}
|
||||
@@ -225,7 +225,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void AvailableCustomTypesWorks()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("FormCustom/AvailableCustomTypes", await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("form-custom/availablecustomtypes", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(4);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user