From 14a8737acf0236b45600876334fe4eeffea78816 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sat, 17 Oct 2020 02:39:16 +0500 Subject: [PATCH] Fix tests --- src/tests/forms.rs | 8 ++++++++ src/tests/requests.rs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tests/forms.rs b/src/tests/forms.rs index 6db331c..07203ec 100644 --- a/src/tests/forms.rs +++ b/src/tests/forms.rs @@ -7,6 +7,7 @@ mod forms { #[test] fn user_sign_up() { let form = forms::UserSignUp { + authenticity_token: "".to_string(), username: "kotovalexarian".to_string(), password: "q1w2e3r4t5y6".to_string(), password_confirmation: "q1w2e3r4t5y6".to_string(), @@ -18,6 +19,7 @@ mod forms { #[test] fn user_sign_up_with_empty_username() { let form = forms::UserSignUp { + authenticity_token: "".to_string(), username: "".to_string(), password: "q1w2e3r4t5y6".to_string(), password_confirmation: "q1w2e3r4t5y6".to_string(), @@ -29,6 +31,7 @@ mod forms { #[test] fn user_sign_up_with_blank_username() { let form = forms::UserSignUp { + authenticity_token: "".to_string(), username: " ".to_string(), password: "q1w2e3r4t5y6".to_string(), password_confirmation: "q1w2e3r4t5y6".to_string(), @@ -40,6 +43,7 @@ mod forms { #[test] fn user_sign_up_with_too_short_username() { let form = forms::UserSignUp { + authenticity_token: "".to_string(), username: "foo".to_string(), password: "q1w2e3r4t5y6".to_string(), password_confirmation: "q1w2e3r4t5y6".to_string(), @@ -51,6 +55,7 @@ mod forms { #[test] fn user_sign_up_with_empty_password() { let form = forms::UserSignUp { + authenticity_token: "".to_string(), username: "kotovalexarian".to_string(), password: "".to_string(), password_confirmation: "".to_string(), @@ -62,6 +67,7 @@ mod forms { #[test] fn user_sign_up_with_blank_password() { let form = forms::UserSignUp { + authenticity_token: "".to_string(), username: "kotovalexarian".to_string(), password: " ".to_string(), password_confirmation: " ".to_string(), @@ -73,6 +79,7 @@ mod forms { #[test] fn user_sign_up_with_too_short_password() { let form = forms::UserSignUp { + authenticity_token: "".to_string(), username: "kotovalexarian".to_string(), password: "1234567".to_string(), password_confirmation: "1234567".to_string(), @@ -84,6 +91,7 @@ mod forms { #[test] fn user_sign_up_with_invalid_password_confirmation() { let form = forms::UserSignUp { + authenticity_token: "".to_string(), username: "kotovalexarian".to_string(), password: "q1w2e3r4t5y6".to_string(), password_confirmation: "q1w2e3r4t5y6aaa".to_string(), diff --git a/src/tests/requests.rs b/src/tests/requests.rs index 8707d78..86d60d2 100644 --- a/src/tests/requests.rs +++ b/src/tests/requests.rs @@ -8,7 +8,7 @@ mod requests { fn client() -> Client { let config = config::Config::default().unwrap(); - let rocket = web::rocket(config).unwrap(); + let rocket = web::rocket(&config).unwrap(); Client::new(rocket).unwrap() }