Ruby on Rails: more verbose tests -


this test keeps failing , don't know why:

  test "correctly formatted profile_name2"     user = user.new(first_name: 'jim', last_name: 'johnson', email: 'jim@teamtreehouse.com', password: 'awfawwf', profile_name: "jimmy")     puts user.errors.inspect     assert user.valid?   end 

i tried find out puts user.errors.inspect statement, array (i think) lists database input rather precisely what's failing.

for clarification:

<activemodel::errors:0x00000103c8ad30 @base=#<user id: nil, first_name: "jim", last_name: "johnson", profile_name: "jimmy", email: "jim@teamtreehouse.com", 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, statements used in tests print screen explicitly what's going wrong?

instead of outputting more verbose information within tests, might set testopts argument verbose output when run tests.

for example set this:

rake test testopts="-v" 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -