Fix tests
This commit is contained in:
parent
21d79d292b
commit
14a8737acf
|
@ -7,6 +7,7 @@ mod forms {
|
||||||
#[test]
|
#[test]
|
||||||
fn user_sign_up() {
|
fn user_sign_up() {
|
||||||
let form = forms::UserSignUp {
|
let form = forms::UserSignUp {
|
||||||
|
authenticity_token: "".to_string(),
|
||||||
username: "kotovalexarian".to_string(),
|
username: "kotovalexarian".to_string(),
|
||||||
password: "q1w2e3r4t5y6".to_string(),
|
password: "q1w2e3r4t5y6".to_string(),
|
||||||
password_confirmation: "q1w2e3r4t5y6".to_string(),
|
password_confirmation: "q1w2e3r4t5y6".to_string(),
|
||||||
|
@ -18,6 +19,7 @@ mod forms {
|
||||||
#[test]
|
#[test]
|
||||||
fn user_sign_up_with_empty_username() {
|
fn user_sign_up_with_empty_username() {
|
||||||
let form = forms::UserSignUp {
|
let form = forms::UserSignUp {
|
||||||
|
authenticity_token: "".to_string(),
|
||||||
username: "".to_string(),
|
username: "".to_string(),
|
||||||
password: "q1w2e3r4t5y6".to_string(),
|
password: "q1w2e3r4t5y6".to_string(),
|
||||||
password_confirmation: "q1w2e3r4t5y6".to_string(),
|
password_confirmation: "q1w2e3r4t5y6".to_string(),
|
||||||
|
@ -29,6 +31,7 @@ mod forms {
|
||||||
#[test]
|
#[test]
|
||||||
fn user_sign_up_with_blank_username() {
|
fn user_sign_up_with_blank_username() {
|
||||||
let form = forms::UserSignUp {
|
let form = forms::UserSignUp {
|
||||||
|
authenticity_token: "".to_string(),
|
||||||
username: " ".to_string(),
|
username: " ".to_string(),
|
||||||
password: "q1w2e3r4t5y6".to_string(),
|
password: "q1w2e3r4t5y6".to_string(),
|
||||||
password_confirmation: "q1w2e3r4t5y6".to_string(),
|
password_confirmation: "q1w2e3r4t5y6".to_string(),
|
||||||
|
@ -40,6 +43,7 @@ mod forms {
|
||||||
#[test]
|
#[test]
|
||||||
fn user_sign_up_with_too_short_username() {
|
fn user_sign_up_with_too_short_username() {
|
||||||
let form = forms::UserSignUp {
|
let form = forms::UserSignUp {
|
||||||
|
authenticity_token: "".to_string(),
|
||||||
username: "foo".to_string(),
|
username: "foo".to_string(),
|
||||||
password: "q1w2e3r4t5y6".to_string(),
|
password: "q1w2e3r4t5y6".to_string(),
|
||||||
password_confirmation: "q1w2e3r4t5y6".to_string(),
|
password_confirmation: "q1w2e3r4t5y6".to_string(),
|
||||||
|
@ -51,6 +55,7 @@ mod forms {
|
||||||
#[test]
|
#[test]
|
||||||
fn user_sign_up_with_empty_password() {
|
fn user_sign_up_with_empty_password() {
|
||||||
let form = forms::UserSignUp {
|
let form = forms::UserSignUp {
|
||||||
|
authenticity_token: "".to_string(),
|
||||||
username: "kotovalexarian".to_string(),
|
username: "kotovalexarian".to_string(),
|
||||||
password: "".to_string(),
|
password: "".to_string(),
|
||||||
password_confirmation: "".to_string(),
|
password_confirmation: "".to_string(),
|
||||||
|
@ -62,6 +67,7 @@ mod forms {
|
||||||
#[test]
|
#[test]
|
||||||
fn user_sign_up_with_blank_password() {
|
fn user_sign_up_with_blank_password() {
|
||||||
let form = forms::UserSignUp {
|
let form = forms::UserSignUp {
|
||||||
|
authenticity_token: "".to_string(),
|
||||||
username: "kotovalexarian".to_string(),
|
username: "kotovalexarian".to_string(),
|
||||||
password: " ".to_string(),
|
password: " ".to_string(),
|
||||||
password_confirmation: " ".to_string(),
|
password_confirmation: " ".to_string(),
|
||||||
|
@ -73,6 +79,7 @@ mod forms {
|
||||||
#[test]
|
#[test]
|
||||||
fn user_sign_up_with_too_short_password() {
|
fn user_sign_up_with_too_short_password() {
|
||||||
let form = forms::UserSignUp {
|
let form = forms::UserSignUp {
|
||||||
|
authenticity_token: "".to_string(),
|
||||||
username: "kotovalexarian".to_string(),
|
username: "kotovalexarian".to_string(),
|
||||||
password: "1234567".to_string(),
|
password: "1234567".to_string(),
|
||||||
password_confirmation: "1234567".to_string(),
|
password_confirmation: "1234567".to_string(),
|
||||||
|
@ -84,6 +91,7 @@ mod forms {
|
||||||
#[test]
|
#[test]
|
||||||
fn user_sign_up_with_invalid_password_confirmation() {
|
fn user_sign_up_with_invalid_password_confirmation() {
|
||||||
let form = forms::UserSignUp {
|
let form = forms::UserSignUp {
|
||||||
|
authenticity_token: "".to_string(),
|
||||||
username: "kotovalexarian".to_string(),
|
username: "kotovalexarian".to_string(),
|
||||||
password: "q1w2e3r4t5y6".to_string(),
|
password: "q1w2e3r4t5y6".to_string(),
|
||||||
password_confirmation: "q1w2e3r4t5y6aaa".to_string(),
|
password_confirmation: "q1w2e3r4t5y6aaa".to_string(),
|
||||||
|
|
|
@ -8,7 +8,7 @@ mod requests {
|
||||||
|
|
||||||
fn client() -> Client {
|
fn client() -> Client {
|
||||||
let config = config::Config::default().unwrap();
|
let config = config::Config::default().unwrap();
|
||||||
let rocket = web::rocket(config).unwrap();
|
let rocket = web::rocket(&config).unwrap();
|
||||||
Client::new(rocket).unwrap()
|
Client::new(rocket).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue