Forum: Ruby on Rails RE: First unit test fails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-02-15 22: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.

Regards,

Dan
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-02-16 12:23
Thanks. I should have read a few pages ahead! .to_s works fine.

Lindsay
This topic is locked and can not be replied to.