Forum: Ruby on Rails unit testing date columns

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.
5a992f256f765f8ee3dbb2af9d3db4e0?d=identicon&s=25 Robbie Shepherd (robbie)
on 2006-03-11 11:54
I'm trying to run my first tests, following along the tute in Agile Web
Dev with rails book.

I have a table with a created_at timestamp column in mysql.

My test always fails when testing the result of the created_at column.
The book says my test should look like:
assert_equal "2006-03-09 21:01:37",

but when I run my test I get 1 error returned:
"undefined method date_available_before_type_cast"

what am I doing wrong?
009c581be96c1c9a2da7da4741c9580b?d=identicon&s=25 Anonymous (Guest)
on 2006-04-12 15:45
(Received via mailing list)
There is an undefined method because your @thing has no date_available

You only need to add the _before_type_cast suffix to make it work.

This topic is locked and can not be replied to.