From 35b9b12aaf7ad583cc1a693cdeaa8b56ccfab477 Mon Sep 17 00:00:00 2001 From: cschen Date: Sun, 3 Nov 2024 17:23:00 +0100 Subject: [PATCH] test: deleting twice or non existing is an error --- src/tests/client.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/tests/client.rs b/src/tests/client.rs index a972628..c6a0df3 100644 --- a/src/tests/client.rs +++ b/src/tests/client.rs @@ -149,6 +149,25 @@ async fn test_delete_empty_workspace() { }) .await } + +#[tokio::test] +async fn test_deleting_twice_or_non_existing_is_an_error() { + ClientFixture::of("alice") + .with(|client| { + let client = client.clone(); + + async move { + let workspace_name = uuid::Uuid::new_v4().to_string(); + + client.create_workspace(&workspace_name).await?; + client.delete_workspace(&workspace_name).await?; + + assert_or_err!(client.delete_workspace(&workspace_name).await.is_err()); + Ok(()) + } + }) + .await +} .await; }