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;
2424async fn test_database_operations() {
2525 // Create a new test database with all migrations applied
2626 let test_db = TestDatabase::new();
27-
27+
2828 // Get an async connection
2929 let mut conn = test_db.async_connect().await;
30-
30+
3131 // Perform your database operations...
3232 // Database is automatically cleaned up when test_db is dropped
3333}
@@ -45,7 +45,7 @@ fn test_with_empty_database() {
4545 // Create an empty database without migrations
4646 let test_db = TestDatabase::empty();
4747 let mut conn = test_db.connect();
48-
48+
4949 // Database starts completely empty
5050}
5151```
@@ -59,7 +59,7 @@ use crates_io_test_db::TestDatabase;
5959fn test_with_database_url() {
6060 let test_db = TestDatabase::new();
6161 let url = test_db.url();
62-
62+
6363 // Use the URL with your preferred database client
6464}
6565```
@@ -83,6 +83,7 @@ export TEST_DATABASE_URL="postgres://postgres:postgres@localhost/crates_io_test"
8383```
8484
8585The crate will automatically create:
86+
8687- A template database: ` crates_io_test_template ` (with all migrations applied)
8788- Individual test databases: ` crates_io_test_<random_suffix> ` (created from template)
8889
Original file line number Diff line number Diff line change @@ -81,9 +81,9 @@ impl BackgroundJob for SendEmailJob {
8181 const PRIORITY: i16 = 10;
8282 const DEDUPLICATED: bool = false;
8383 const QUEUE: &'static str = "emails";
84-
84+
8585 type Context = AppContext;
86-
86+
8787 async fn run(&self, ctx: Self::Context) -> anyhow::Result<()> {
8888 // Job implementation
8989 ctx.email_service.send(&self.to, &self.subject, &self.body).await?;
You can’t perform that action at this time.
0 commit comments