what does loco offers

This commit is contained in:
Priec
2026-05-15 22:31:26 +02:00
parent 0c25fa5d11
commit 8b7f883f14
22 changed files with 731 additions and 5 deletions

View File

@@ -0,0 +1,31 @@
use ht_booking::app::App;
use loco_rs::testing::prelude::*;
use serial_test::serial;
macro_rules! configure_insta {
($($expr:expr),*) => {
let mut settings = insta::Settings::clone_current();
settings.set_prepend_module_to_snapshot(false);
let _guard = settings.bind_to_scope();
};
}
#[tokio::test]
#[serial]
async fn test_model() {
configure_insta!();
let boot = boot_test::<App>().await.unwrap();
seed::<App>(&boot.app_context).await.unwrap();
// query your model, e.g.:
//
// let item = models::posts::Model::find_by_pid(
// &boot.app_context.db,
// "11111111-1111-1111-1111-111111111111",
// )
// .await;
// snapshot the result:
// assert_debug_snapshot!(item);
}

View File

@@ -1 +1,3 @@
mod users;
mod courts;