From 5ee70d9508a11dbc6f77a9196e9860c60b3da77e Mon Sep 17 00:00:00 2001 From: Mara Schulke Date: Mon, 26 Feb 2024 19:26:10 +0100 Subject: [PATCH] Make use of find_all in the read test --- atmosphere-core/src/testing.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/atmosphere-core/src/testing.rs b/atmosphere-core/src/testing.rs index 5e4050b..948da86 100644 --- a/atmosphere-core/src/testing.rs +++ b/atmosphere-core/src/testing.rs @@ -59,6 +59,11 @@ where "instance was found (find_optional) after deletion" ); + assert!( + E::find_all(pool).await.unwrap().is_empty(), + "there was an instance found in the database before creating" + ); + instance.create(pool).await.expect("insertion did not work"); let retrieved = E::find(instance.pk(), pool) @@ -66,6 +71,8 @@ where .expect("instance not found after insertion"); assert_eq!(instance, retrieved); + + assert_eq!(E::find_all(pool).await.unwrap(), vec![instance.clone()]); } /// Tests updating of an entity in the database.