Use Date.current and Time.current
Using Date.today and Time.now might lead to inconsistencies if the time zone the application uses is not the same as the system time zone.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe "Retrieves number of supports for the successful proposal" do
|
||||
let(:created_at) { Time.now.beginning_of_day - 9.days }
|
||||
let(:created_at) { Date.current.beginning_of_day - 9.days }
|
||||
let(:proposal) { create(:proposal, created_at: created_at, published_at: created_at) }
|
||||
|
||||
before do
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Dashboard::GroupSupports do
|
||||
let(:created_at) { Time.now - 9.days }
|
||||
let(:created_at) { Time.current - 9.days }
|
||||
let(:proposal) { create(:proposal, created_at: created_at, published_at: created_at) }
|
||||
|
||||
before do
|
||||
|
||||
Reference in New Issue
Block a user