From 9ff9a47d86c94d377d30671e792f283d5d35b4a2 Mon Sep 17 00:00:00 2001 From: cschen Date: Sun, 3 Nov 2024 17:20:09 +0100 Subject: [PATCH] test: can't create workspace more than once --- src/tests/client.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/tests/client.rs b/src/tests/client.rs index 53025f0..56a7680 100644 --- a/src/tests/client.rs +++ b/src/tests/client.rs @@ -30,6 +30,23 @@ async fn test_workspace_creation_and_lookup() { }) .await } + +#[tokio::test] +async fn test_cant_create_same_workspace_more_than_once() { + 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?; + assert_or_err!(client.create_workspace(workspace_name).await.is_err()); + Ok(()) + } + }) + .await +} Ok(()) } })