changes tests to a macro (#822)

This commit is contained in:
Wyatt Verchere
2024-01-06 11:08:03 -08:00
committed by GitHub
parent 10eed05d87
commit 87862f3e23
32 changed files with 423 additions and 391 deletions

View File

@@ -1,5 +1,6 @@
use crate::assert_status;
use crate::common::api_common::ApiProject;
use crate::common::asserts::assert_status;
use actix_http::StatusCode;
use actix_web::test;
use bytes::Bytes;
@@ -15,7 +16,7 @@ pub async fn error_404_empty() {
// V2 errors should have 404 as blank body, for missing resources
let api = &test_env.api;
let resp = api.get_project("does-not-exist", USER_USER_PAT).await;
assert_status(&resp, StatusCode::NOT_FOUND);
assert_status!(&resp, StatusCode::NOT_FOUND);
let body = test::read_body(resp).await;
let empty_bytes = Bytes::from_static(b"");
assert_eq!(body, empty_bytes);