1
0
Fork 0

Fix tests

This commit is contained in:
Alex Kotov 2020-10-17 02:39:16 +05:00
parent 21d79d292b
commit 14a8737acf
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
2 changed files with 9 additions and 1 deletions

View File

@ -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(),

View File

@ -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()
}