test: can't create workspace more than once

This commit is contained in:
cschen 2024-11-03 17:20:09 +01:00
parent 44e5e390eb
commit 9ff9a47d86

View file

@ -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(())
}
})