File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ use crates_io_test_db::TestDatabase;
24
24
async fn test_database_operations() {
25
25
// Create a new test database with all migrations applied
26
26
let test_db = TestDatabase::new();
27
-
27
+
28
28
// Get an async connection
29
29
let mut conn = test_db.async_connect().await;
30
-
30
+
31
31
// Perform your database operations...
32
32
// Database is automatically cleaned up when test_db is dropped
33
33
}
@@ -45,7 +45,7 @@ fn test_with_empty_database() {
45
45
// Create an empty database without migrations
46
46
let test_db = TestDatabase::empty();
47
47
let mut conn = test_db.connect();
48
-
48
+
49
49
// Database starts completely empty
50
50
}
51
51
```
@@ -59,7 +59,7 @@ use crates_io_test_db::TestDatabase;
59
59
fn test_with_database_url() {
60
60
let test_db = TestDatabase::new();
61
61
let url = test_db.url();
62
-
62
+
63
63
// Use the URL with your preferred database client
64
64
}
65
65
```
@@ -83,6 +83,7 @@ export TEST_DATABASE_URL="postgres://postgres:postgres@localhost/crates_io_test"
83
83
```
84
84
85
85
The crate will automatically create:
86
+
86
87
- A template database: ` crates_io_test_template ` (with all migrations applied)
87
88
- Individual test databases: ` crates_io_test_<random_suffix> ` (created from template)
88
89
Original file line number Diff line number Diff line change @@ -81,9 +81,9 @@ impl BackgroundJob for SendEmailJob {
81
81
const PRIORITY: i16 = 10;
82
82
const DEDUPLICATED: bool = false;
83
83
const QUEUE: &'static str = "emails";
84
-
84
+
85
85
type Context = AppContext;
86
-
86
+
87
87
async fn run(&self, ctx: Self::Context) -> anyhow::Result<()> {
88
88
// Job implementation
89
89
ctx.email_service.send(&self.to, &self.subject, &self.body).await?;
You can’t perform that action at this time.
0 commit comments