Time.local => Time.zone.local

This commit is contained in:
simon lehericey 2018-10-25 15:24:31 +02:00
parent 3078b377c7
commit 26ae29ea52
2 changed files with 4 additions and 4 deletions

View file

@ -49,7 +49,7 @@ RSpec.describe CommentaireHelper, type: :helper do
end end
describe '.commentaire_date' do describe '.commentaire_date' do
let(:present_date) { Time.local(2018, 9, 2, 10, 5, 0) } let(:present_date) { Time.zone.local(2018, 9, 2, 10, 5, 0) }
let(:creation_date) { present_date } let(:creation_date) { present_date }
let(:commentaire) do let(:commentaire) do
Timecop.freeze(creation_date) { create(:commentaire, email: "michel@pref.fr") } Timecop.freeze(creation_date) { create(:commentaire, email: "michel@pref.fr") }
@ -71,7 +71,7 @@ RSpec.describe CommentaireHelper, type: :helper do
end end
context 'when formatting the first day of the month' do context 'when formatting the first day of the month' do
let(:present_date) { Time.local(2018, 9, 1, 10, 5, 0) } let(:present_date) { Time.zone.local(2018, 9, 1, 10, 5, 0) }
it 'includes the ordinal' do it 'includes the ordinal' do
expect(subject).to eq 'le 1er septembre à 10 h 05' expect(subject).to eq 'le 1er septembre à 10 h 05'
end end

View file

@ -4,8 +4,8 @@ describe '2018_03_06_clean_html_textareas#clean' do
let(:procedure) { create(:procedure) } let(:procedure) { create(:procedure) }
let(:type_champ) { create(:type_de_champ_textarea, procedure: procedure) } let(:type_champ) { create(:type_de_champ_textarea, procedure: procedure) }
let(:champ) { type_champ.champ.create(value: "<p>Gnahar<br>greu bouahaha</p>") } let(:champ) { type_champ.champ.create(value: "<p>Gnahar<br>greu bouahaha</p>") }
let(:champ_date) { Time.local(1995) } let(:champ_date) { Time.zone.local(1995) }
let(:rake_date) { Time.local(2018) } let(:rake_date) { Time.zone.local(2018) }
let(:rake_task) { Rake::Task['2018_03_06_clean_html_textareas:clean'] } let(:rake_task) { Rake::Task['2018_03_06_clean_html_textareas:clean'] }
before do before do