本文整理匯總了TypeScript中models/secret_configs/secret_configs_crud.SecretConfigsCRUD.delete方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript SecretConfigsCRUD.delete方法的具體用法?TypeScript SecretConfigsCRUD.delete怎麽用?TypeScript SecretConfigsCRUD.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models/secret_configs/secret_configs_crud.SecretConfigsCRUD
的用法示例。
在下文中一共展示了SecretConfigsCRUD.delete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("should delete a secret config", () => {
const secretConfig = SecretConfig.fromJSON(secretConfigTestData());
const SECRET_CONFIG_PATH = `${BASE_PATH}/${secretConfig.id()}`;
jasmine.Ajax.stubRequest(SECRET_CONFIG_PATH).andReturn(deleteSecretConfigResponse(secretConfig.id()));
const onResponse = jasmine.createSpy().and.callFake((response: ApiResult<string>) => {
const responseJSON = response.unwrap() as SuccessResponse<any>;
expect(responseJSON.body.message).toEqual(`Secret Configuration ${secretConfig.id()} was deleted successfully!`);
expect(response.getEtag()).toEqual("some-etag");
});
SecretConfigsCRUD.delete(secretConfig).then(onResponse);
const request = jasmine.Ajax.requests.mostRecent();
expect(request.url).toEqual("/go/api/admin/secret_configs/secrets_id");
expect(request.method).toEqual("DELETE");
expect(request.requestHeaders.Accept).toEqual("application/vnd.go.cd.v1+json");
});