Date.today == Date.yesterday
Date.today uses your current time zone, while Date.yesterday defaults to UTC. Why the difference? Date.today is a built in Ruby method, while Date.yesterday and Date.tomorrow are Rails helpers. The Rails team doesn't like redefining methods built in to Ruby, so they introduced Date.current to be used with Date.yesterday and Date.tomorrow. The upshot is, late in the afternoon in SF, Date.today will be equal to Date.yesterday, which may lead to unexpected behavior or failing tests.