Skip to main content

toasty_driver_integration_suite/scenarios/
task_with_status.rs

1use crate::prelude::*;
2
3scenario! {
4    #[derive(Debug, toasty::Model)]
5    #[allow(dead_code)]
6    struct Task {
7        #[key]
8        #[auto]
9        id: uuid::Uuid,
10
11        title: String,
12
13        status: Status,
14    }
15
16    #[derive(Debug, PartialEq, toasty::Embed)]
17    enum Status {
18        #[column(variant = 1)]
19        Pending,
20        #[column(variant = 2)]
21        Failed { reason: String },
22        #[column(variant = 3)]
23        Done,
24    }
25
26    async fn setup(test: &mut Test) -> toasty::Db {
27        test.setup_db(models!(Task)).await
28    }
29}