Skip to main content

toasty_driver_integration_suite/scenarios/
task_bug_priority.rs

1use crate::prelude::*;
2
3scenario! {
4    #![id(ID)]
5
6    #[derive(Debug, toasty::Model)]
7    #[allow(dead_code)]
8    struct Task {
9        #[key]
10        #[auto]
11        id: ID,
12
13        title: String,
14
15        priority: Priority,
16    }
17
18    #[derive(Debug, toasty::Model)]
19    #[allow(dead_code)]
20    struct Bug {
21        #[key]
22        #[auto]
23        id: ID,
24
25        summary: String,
26
27        priority: Priority,
28    }
29
30    #[derive(Debug, PartialEq, toasty::Embed)]
31    enum Priority {
32        Low,
33        Medium,
34        High,
35    }
36
37    async fn setup(test: &mut Test) -> toasty::Db {
38        test.setup_db(models!(Task, Bug)).await
39    }
40}