This test keeps failing and I don't know why:
test "correctly formatted profile_name2" do
user = User.new(first_name: 'Jim', last_name: 'Johnson', email: '[email protected]', password: 'awfawwf', profile_name: "jimmy")
puts user.errors.inspect
assert user.valid?
end
I tried to find out by that puts user.errors.inspect
statement, but I get back an array (I think) that simply lists database input rather than precisely what's failing.
For clarification:
<ActiveModel::Errors:0x00000103c8ad30 @base=#<User id: nil, first_name: "Jim", last_name: "Johnson", profile_name: "jimmy", email: "[email protected]", encrypted_password: "$2a$04$LTOb5O.gG0DEITsb/HDOb.fPLP83LaXzKlEerwCDE1og...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, confirmation_token: nil, confirmed_at: nil, confirmation_sent_at: nil, unconfirmed_email: nil, failed_attempts: 0, unlock_token: nil, locked_at: nil, authentication_token: nil, created_at: nil, updated_at: nil>, @messages={}>
In future tests, what statements are used in tests to print to screen explicitly what's going wrong?
Instead of outputting more verbose information within your tests, it might also help to set the TESTOPTS argument to get verbose output when you run your tests.
For example you would set it like this:
rake test TESTOPTS="-v"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With