Commit 35d65cf1868ae5c5bbdd18822291d17b320761c7
1 parent
f34d8e89
Exists in
master
and in
1 other branch
fix test to account for utc in db
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/tasks/test_api.rake
@@ -364,7 +364,7 @@ namespace :test_api do | @@ -364,7 +364,7 @@ namespace :test_api do | ||
364 | 364 | ||
365 | question.expire_prompt_cache_tracking_keys(Date.yesterday) | 365 | question.expire_prompt_cache_tracking_keys(Date.yesterday) |
366 | 366 | ||
367 | - yesterday_appearances = question.appearances.count(:conditions => ['date(created_at) = ?', Date.yesterday]) | 367 | + yesterday_appearances = question.appearances.count(:conditions => ['created_at >= ? AND created_at < ?', Time.now.yesterday.midnight.utc, Time.now.midnight.utc]) |
368 | 368 | ||
369 | if misses + hits != yesterday_appearances | 369 | if misses + hits != yesterday_appearances |
370 | error_message += "Error! Question #{question.id} isn't tracking prompt cache hits and misses accurately! Expected #{yesterday_appearances}, Actual: #{misses+hits}, Hits: #{hits}, Misses: #{misses}\n" | 370 | error_message += "Error! Question #{question.id} isn't tracking prompt cache hits and misses accurately! Expected #{yesterday_appearances}, Actual: #{misses+hits}, Hits: #{hits}, Misses: #{misses}\n" |