I have a simple rails 2.0.2 app with one model, Portfolio, and
generated CRUD. I’ve added validation to the model and tested it
thoroughly by hand – it works fine.
I tried to create a unit test to ensure no inadvertent future changes
break my validations.
The relevant code is at http://www.pastie.org/230714.
ruby test/unit/portfolio_test.rb fails with (essentially)
portfolio_test_rb:13 is not true.
Why did this fail
I thought perhaps the previous failure occurred because I didn’t save
the new portfolio. But when I un-comment portfolio_test.rb:8, I get
a new error:
NoMethodError: You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.upcase!
Thanks in advance for any light you can shine on my errors,