#135 ✓hold
Matt Aimonetti

updated_at value isn't set properly

Reported by Matt Aimonetti | October 18th, 2007 @ 01:59 PM

Let's say you want to test a method returning only items saved before today.

scenario :posts do

%w( title1 title2 ).each do |title|

Post.create! :title => title, :updated_at => Date.today -1

end

end

the updated_at value won't be set properly.

Comments and changes to this ticket

  • Chris Wanstrath

    Chris Wanstrath October 29th, 2007 @ 01:10 PM

    • State changed from “new” to “hold”

    Right now you can accomplish this with Model.record_timestamps = false. Maybe I should add a :timestamps => false option to the scenario method? What do you think?

  • Matt Aimonetti (mattetti)

    Matt Aimonetti (mattetti) November 8th, 2007 @ 06:34 PM

    I didn't try your code against the latest trunk changes to fixtures (rathole got merged in core).

    However if it's still compatible, I would definitely suggest to add an option to the scenario method.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

Pages