add thumbnails model

This commit is contained in:
2024-11-07 18:11:02 +01:00
parent 033073dd26
commit eea2472f6b
12 changed files with 209 additions and 4 deletions

View File

@@ -3,4 +3,5 @@ mod users;
mod skills;
mod jobs;
mod projects;
mod data;
mod data;
mod project_thumbnails;

View File

@@ -0,0 +1,31 @@
use gabrielkaszewski_rs::app::App;
use loco_rs::testing;
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 = testing::boot_test::<App>().await.unwrap();
testing::seed::<App>(&boot.app_context.db).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);
}