Always use Time.current (aliases internally to Time.zone.now)

Some specs where breaking close to midnight because 30.years.ago uses zone.now and Time.now.utc.to_date doesn't.
Also this will make all codebase consistent in the way time is deal with
This commit is contained in:
Bertocq
2017-05-24 07:54:48 +02:00
parent 72facb8e65
commit 9e74249b02
5 changed files with 10 additions and 10 deletions

View File

@@ -407,7 +407,7 @@ tags = Faker::Lorem.words(10)
title: Faker::Lorem.sentence(3).truncate(60),
external_url: Faker::Internet.url,
description: "<p>#{Faker::Lorem.paragraphs.join('</p><p>')}</p>",
created_at: rand((Time.now - 1.week) .. Time.now),
created_at: rand((Time.current - 1.week) .. Time.current),
feasibility: %w{undecided unfeasible feasible feasible feasible feasible}.sample,
unfeasibility_explanation: Faker::Lorem.paragraph,
valuation_finished: [false, true].sample,
@@ -436,7 +436,7 @@ budget = Budget.where(phase: "finished").last
title: Faker::Lorem.sentence(3).truncate(60),
external_url: Faker::Internet.url,
description: "<p>#{Faker::Lorem.paragraphs.join('</p><p>')}</p>",
created_at: rand((Time.now - 1.week) .. Time.now),
created_at: rand((Time.current - 1.week) .. Time.current),
feasibility: "feasible",
valuation_finished: true,
selected: true,