Forum: Ruby on Rails RE: First unit test fails

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Berger, Daniel (Guest)
on 2006-02-15 23:28
(Received via mailing list)
> fixture and unit test to check the creation of an order. When
> <Wed Feb 15 12:56:26 GMT 2006>.
> 1 tests, 6 assertions, 1 failures, 0 errors

Looks like you're comparing a string against a Time object (note the
quotes in the expected value, and the lack of quotes in the actual
value).  Take a look at p. 145 (under Create and Read), where they talk
about _before_type_cast.

Me? I just use the .to_s method.


Lindsay B. (Guest)
on 2006-02-16 13:23
Thanks. I should have read a few pages ahead! .to_s works fine.

This topic is locked and can not be replied to.