Chapter 3.9
+ Update tests to incorporate new structure. + Adjust tests to connect to database
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::net::TcpListener;
|
||||
use sqlx::{PgConnection, Connection};
|
||||
use mail_app::startup::run;
|
||||
use mail_app::configuration::get_configuration;
|
||||
use mail_app::startup::run;
|
||||
use sqlx::{Connection, PgConnection};
|
||||
use std::net::TcpListener;
|
||||
|
||||
fn spawn_app() -> String {
|
||||
let listener = TcpListener::bind("127.0.0.1:0").expect("Failed to bind to random port.");
|
||||
@@ -59,7 +59,7 @@ async fn subscribe_returns_a_200_for_valid_form_data() {
|
||||
.fetch_one(&mut connection)
|
||||
.await
|
||||
.expect("Failed to fetch saved subscription.");
|
||||
|
||||
|
||||
assert_eq!(saved.email, "ursula_le_guin@gmail.com");
|
||||
assert_eq!(saved.name, "le guin");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user