Cześć, jakie jest najlepsze podejście do testowania validacji?
Załóżmy, dla uproszczenia, że przy rejestracji wymagane jest tylko email i password, więc testy mogą wyglądać tak:
test_request_should_fail_when_email_is_not_provided,
test_request_should_fail_when_email_invalid,
test_request_should_fail_when_email_exists_in_database,
test_request_should_fail_when_password_is_not_provided,
test_request_should_fail_when_password_is_too_long,
test_request_should_fail_when_password_is_too_short,
test_request_should_fail_when_password_is_not_contains_large_letter,
test_request_should_fail_when_password_is_not_contains_special_character,
test_request_should_fail_when_password_is_not_contains_number,
test_request_should_fail_when_password_confirmation_is_different_from_password
a to tylko 2 pola, często jest ich dużo więcej