This commit is contained in:
@@ -73,7 +73,7 @@ namespace raven_integration
|
||||
formDataContent.Add(file2);
|
||||
|
||||
//create via inventory full test user as attachments use the role of the object attaching to
|
||||
a = await Util.PostFormDataAsync("Attachment", formDataContent, await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.PostFormDataAsync("attachment", formDataContent, await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
|
||||
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
@@ -90,7 +90,7 @@ namespace raven_integration
|
||||
//// DOWNLOAD: Get the file attachment
|
||||
|
||||
//now get the file https://rockfish.ayanova.com/api/rfcaseblob/download/248?t=9O2eDAAlZ0Wknj19SBK2iA
|
||||
var dlresponse = await Util.DownloadFileAsync("Attachment/Download/" + lTestZipAttachmentId.ToString() + "?t=" + downloadToken, null);
|
||||
var dlresponse = await Util.DownloadFileAsync("attachment/Download/" + lTestZipAttachmentId.ToString() + "?t=" + downloadToken, null);
|
||||
|
||||
//ensure it's the zip file we expected
|
||||
dlresponse.Content.Headers.ContentDisposition.FileName.Should().Be("test.zip");
|
||||
@@ -99,10 +99,10 @@ namespace raven_integration
|
||||
|
||||
//////////////////////////////////////////
|
||||
//// DELETE: Delete the file attachments
|
||||
a = await Util.DeleteAsync("Attachment/" + lTestPngAttachmentId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("attachment/" + lTestPngAttachmentId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Attachment/" + lTestZipAttachmentId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("attachment/" + lTestZipAttachmentId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace raven_integration
|
||||
formDataContent.Add(file1);
|
||||
|
||||
//ERROR CONDITION: BizAdminLimited user should not be able to attach a file to a widget
|
||||
ApiResponse a = await Util.PostFormDataAsync("Attachment", formDataContent, await Util.GetTokenAsync("BizAdminLimited"));
|
||||
ApiResponse a = await Util.PostFormDataAsync("attachment", formDataContent, await Util.GetTokenAsync("BizAdminLimited"));
|
||||
|
||||
//2004 unauthorized
|
||||
Util.ValidateErrorCodeResponse(a, 2004, 403);
|
||||
@@ -159,7 +159,7 @@ namespace raven_integration
|
||||
file1.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data");
|
||||
file1.Headers.ContentDisposition.FileName = "test.png";
|
||||
formDataContent.Add(file1);
|
||||
ApiResponse a = await Util.PostFormDataAsync("Attachment", formDataContent, await Util.GetTokenAsync("InventoryFull"));
|
||||
ApiResponse a = await Util.PostFormDataAsync("attachment", formDataContent, await Util.GetTokenAsync("InventoryFull"));
|
||||
|
||||
//2203 unattachable object
|
||||
Util.ValidateErrorCodeResponse(a, 2203, 400);
|
||||
@@ -186,7 +186,7 @@ namespace raven_integration
|
||||
file1.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data");
|
||||
file1.Headers.ContentDisposition.FileName = "test.png";
|
||||
formDataContent.Add(file1);
|
||||
ApiResponse a = await Util.PostFormDataAsync("Attachment", formDataContent, await Util.GetTokenAsync("InventoryFull"));
|
||||
ApiResponse a = await Util.PostFormDataAsync("attachment", formDataContent, await Util.GetTokenAsync("InventoryFull"));
|
||||
|
||||
//2203 invalid attachment object
|
||||
Util.ValidateErrorCodeResponse(a, 2203, 400);
|
||||
|
||||
Reference in New Issue
Block a user