Topic: Syntax Question Two Errors Returned
Hi
I'm new to testing, and have an assertion which returns two errors. I don't seem to be able to get the formatting for two errors right, just wondering if anyone can provide a hint? Thanks ahead. The test is failing as it expects only one of the errors, but returns the other... and putting them in parentheses hasn't worked for me yet either. I've had a quick look online but couldn't find anything. http://manuals.rubyonrails.com is down at the moment.
def test_does_a_user_with_no_password_fail
user = User.new(:email => "test@hotmail.com", :password => "")
assert !user.valid?
assert_equal "email and password must be provided.",
"needs to be at least 5 characters long.",
user.errors.on(:password)
end