Use tokio::test.

This commit is contained in:
LukeMathWalker 2021-01-17 00:27:03 +00:00
parent 9ba07c4834
commit 74b7b1c536

View file

@ -86,7 +86,7 @@ mod tests {
} }
} }
#[actix_rt::test] #[tokio::test]
async fn send_email_sends_the_expected_request() { async fn send_email_sends_the_expected_request() {
// Arrange // Arrange
let mock_server = MockServer::start().await; let mock_server = MockServer::start().await;
@ -115,7 +115,7 @@ mod tests {
// Assert // Assert
} }
#[actix_rt::test] #[tokio::test]
async fn send_email_succeeds_if_the_server_returns_200() { async fn send_email_succeeds_if_the_server_returns_200() {
// Arrange // Arrange
let mock_server = MockServer::start().await; let mock_server = MockServer::start().await;
@ -141,7 +141,7 @@ mod tests {
assert_ok!(outcome); assert_ok!(outcome);
} }
#[actix_rt::test] #[tokio::test]
async fn send_email_fails_if_the_server_returns_500() { async fn send_email_fails_if_the_server_returns_500() {
// Arrange // Arrange
let mock_server = MockServer::start().await; let mock_server = MockServer::start().await;