4648
This commit is contained in:
@@ -23,7 +23,7 @@ namespace raven_integration
|
||||
public async Task TranslationListWorks()
|
||||
{
|
||||
//Get all
|
||||
ApiResponse a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("CustomerLimited"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||
ApiResponse a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("CustomerRestricted"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
//there should be at least 4 of them as there are 4 stock translations
|
||||
@@ -35,7 +35,7 @@ namespace raven_integration
|
||||
public async Task GetFullTranslationWorks()
|
||||
{
|
||||
//Get all
|
||||
ApiResponse a = await Util.GetAsync("translation/1", await Util.GetTokenAsync("CustomerLimited"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||
ApiResponse a = await Util.GetAsync("translation/1", await Util.GetTokenAsync("CustomerRestricted"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
//there should be dozens of keys but at times there might only be a few during development so at least verify there is more than one
|
||||
@@ -54,7 +54,7 @@ namespace raven_integration
|
||||
|
||||
d = JToken.FromObject(keys);
|
||||
|
||||
ApiResponse a = await Util.PostAsync("translation/subset", await Util.GetTokenAsync("CustomerLimited"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("translation/subset", await Util.GetTokenAsync("CustomerRestricted"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
//there should be dozens of keys but at times there might only be a few during development so at least verify there is more than one
|
||||
@@ -71,7 +71,7 @@ namespace raven_integration
|
||||
d.id = 1;
|
||||
d.name = Util.Uniquify("INTEGRATION-TEST-LOCALE");
|
||||
|
||||
ApiResponse a = await Util.PostAsync("translation/Duplicate", await Util.GetTokenAsync("BizAdminFull"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("translation/Duplicate", await Util.GetTokenAsync("BizAdmin"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 201);
|
||||
//verify the object returned is as expected
|
||||
@@ -90,11 +90,11 @@ namespace raven_integration
|
||||
d2.id = NewId;
|
||||
d2.newText = Util.Uniquify("INTEGRATION-TEST-LOCALE NAME UPDATE");
|
||||
d2.concurrency = a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("translation/UpdateTranslationName", await Util.GetTokenAsync("BizAdminFull"), d2.ToString());
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("translation/UpdateTranslationName", await Util.GetTokenAsync("BizAdmin"), d2.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
|
||||
ApiResponse checkPUTWorked = await Util.GetAsync("translation/" + NewId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
ApiResponse checkPUTWorked = await Util.GetAsync("translation/" + NewId.ToString(), await Util.GetTokenAsync("BizAdmin"));
|
||||
Util.ValidateNoErrorInResponse(checkPUTWorked);
|
||||
checkPUTWorked.ObjectResponse["data"]["name"].Value<string>().Should().Be(d2.newText.ToString());
|
||||
//uint concurrency = PUTTestResponse.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
@@ -109,7 +109,7 @@ namespace raven_integration
|
||||
|
||||
string UpdatedTranslationKey = FirstTranslationKey["key"].Value<string>();
|
||||
|
||||
PUTTestResponse = await Util.PutAsync("translation/UpdateTranslationItemDisplayText", await Util.GetTokenAsync("BizAdminFull"), d2.ToString());
|
||||
PUTTestResponse = await Util.PutAsync("translation/UpdateTranslationItemDisplayText", await Util.GetTokenAsync("BizAdmin"), d2.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
//create user that is set to new translation so can use getSubset
|
||||
@@ -174,7 +174,7 @@ namespace raven_integration
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
//DELETE TEMP LOCALE
|
||||
a = await Util.DeleteAsync("translation/" + NewId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.DeleteAsync("translation/" + NewId.ToString(), await Util.GetTokenAsync("BizAdmin"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user