Time.new => Time.zone.local
This commit is contained in:
parent
e684cec516
commit
3078b377c7
5 changed files with 9 additions and 9 deletions
|
@ -53,7 +53,7 @@ describe StatsController, type: :controller do
|
||||||
|
|
||||||
describe '#cumulative_hash' do
|
describe '#cumulative_hash' do
|
||||||
before do
|
before do
|
||||||
Timecop.freeze(Time.new(2016, 10, 2))
|
Timecop.freeze(Time.zone.local(2016, 10, 2))
|
||||||
FactoryBot.create(:procedure, :created_at => 55.days.ago, :updated_at => 43.days.ago)
|
FactoryBot.create(:procedure, :created_at => 55.days.ago, :updated_at => 43.days.ago)
|
||||||
FactoryBot.create(:procedure, :created_at => 45.days.ago, :updated_at => 40.days.ago)
|
FactoryBot.create(:procedure, :created_at => 45.days.ago, :updated_at => 40.days.ago)
|
||||||
FactoryBot.create(:procedure, :created_at => 45.days.ago, :updated_at => 20.days.ago)
|
FactoryBot.create(:procedure, :created_at => 45.days.ago, :updated_at => 20.days.ago)
|
||||||
|
|
|
@ -2,8 +2,8 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe DossierDecorator do
|
describe DossierDecorator do
|
||||||
let(:dossier) do
|
let(:dossier) do
|
||||||
dossier = create(:dossier, created_at: Time.new(2015, 12, 24, 14, 10))
|
dossier = create(:dossier, created_at: Time.zone.local(2015, 12, 24, 14, 10))
|
||||||
dossier.update_column('updated_at', Time.new(2015, 12, 24, 14, 10))
|
dossier.update_column('updated_at', Time.zone.local(2015, 12, 24, 14, 10))
|
||||||
dossier
|
dossier
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe ProcedureDecorator do
|
describe ProcedureDecorator do
|
||||||
let(:published_at) { Time.new(2017, 12, 24, 14, 12) }
|
let(:published_at) { Time.zone.local(2017, 12, 24, 14, 12) }
|
||||||
let(:procedure) { create(:procedure, published_at: published_at, created_at: Time.new(2015, 12, 24, 14, 10)) }
|
let(:procedure) { create(:procedure, published_at: published_at, created_at: Time.zone.local(2015, 12, 24, 14, 10)) }
|
||||||
let!(:procedure_path) { create(:procedure_path, administrateur: create(:administrateur), procedure: procedure) }
|
let!(:procedure_path) { create(:procedure_path, administrateur: create(:administrateur), procedure: procedure) }
|
||||||
|
|
||||||
subject { procedure.decorate }
|
subject { procedure.decorate }
|
||||||
|
|
|
@ -2,9 +2,9 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe ProceduresDecorator do
|
describe ProceduresDecorator do
|
||||||
before do
|
before do
|
||||||
create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))
|
create(:procedure, :published, created_at: Time.zone.local(2015, 12, 24, 14, 10))
|
||||||
create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))
|
create(:procedure, :published, created_at: Time.zone.local(2015, 12, 24, 14, 10))
|
||||||
create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))
|
create(:procedure, :published, created_at: Time.zone.local(2015, 12, 24, 14, 10))
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:procedure) { Procedure.all.page(1) }
|
let(:procedure) { Procedure.all.page(1) }
|
||||||
|
|
|
@ -627,7 +627,7 @@ describe Procedure do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#export_filename" do
|
describe "#export_filename" do
|
||||||
before { Timecop.freeze(Time.new(2018, 1, 2, 23, 11, 14)) }
|
before { Timecop.freeze(Time.zone.local(2018, 1, 2, 23, 11, 14)) }
|
||||||
|
|
||||||
subject { procedure.export_filename }
|
subject { procedure.export_filename }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue