Fix intermittent build failure due to timezones

Because our default timezone for the app is UTC, at certain times, some
tests could fail outside of UTC. This commit fixes that by changing a
single call to Time.now to Time.zone.now.
This commit is contained in:
Joseph Caudle
2013-02-21 22:29:36 -05:00
parent 9e29aec14a
commit 6b37bbc8da

View File

@@ -9,7 +9,7 @@ class Post < ActiveRecord::Base
def author_date_subject
# slugs are created before created_at is set
time = created_at || Time.now
time = created_at || Time.zone.now
"#{author.login_name} #{time.strftime("%Y%m%d")} #{subject}"
end