Skip to main content

toasty_driver_integration_suite/scenarios/
task_bug_priority.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        priority: Priority,
14    }
15
16    #[derive(Debug, toasty::Model)]
17    #[allow(dead_code)]
18    struct Bug {
19        #[key]
20        #[auto]
21        id: uuid::Uuid,
22
23        summary: String,
24
25        priority: Priority,
26    }
27
28    #[derive(Debug, PartialEq, toasty::Embed)]
29    enum Priority {
30        Low,
31        Medium,
32        High,
33    }
34
35    async fn setup(test: &mut Test) -> toasty::Db {
36        test.setup_db(models!(Task, Bug)).await
37    }
38}