DateTime.parse => Time.zone.parse
This commit is contained in:
parent
2238e5bd9f
commit
f620e4aee2
11 changed files with 19 additions and 19 deletions
|
@ -82,7 +82,7 @@ describe FranceConnect::ParticulierController, type: :controller do
|
|||
|
||||
before { subject }
|
||||
|
||||
it { expect(stored_fci).to have_attributes(user_info.merge(birthdate: DateTime.parse(birthdate))) }
|
||||
it { expect(stored_fci).to have_attributes(user_info.merge(birthdate: Time.zone.parse(birthdate))) }
|
||||
end
|
||||
|
||||
it { is_expected.to redirect_to(root_path) }
|
||||
|
|
|
@ -23,7 +23,7 @@ feature 'The user' do
|
|||
fill_in('text', with: 'super texte')
|
||||
fill_in('textarea', with: 'super textarea')
|
||||
fill_in('date', with: '12/12/2012')
|
||||
select_date_and_time(DateTime.parse('06/01/1985 7h05'), form_id_for('datetime'))
|
||||
select_date_and_time(Time.zone.parse('06/01/1985 7h05'), form_id_for('datetime'))
|
||||
fill_in('number', with: '42')
|
||||
check('checkbox')
|
||||
choose('Madame')
|
||||
|
@ -67,7 +67,7 @@ feature 'The user' do
|
|||
expect(page).to have_field('text', with: 'super texte')
|
||||
expect(page).to have_field('textarea', with: 'super textarea')
|
||||
expect(page).to have_field('date', with: '2012-12-12')
|
||||
check_date_and_time(DateTime.parse('06/01/1985 7:05'), form_id_for('datetime'))
|
||||
check_date_and_time(Time.zone.parse('06/01/1985 7:05'), form_id_for('datetime'))
|
||||
expect(page).to have_field('number', with: '42')
|
||||
expect(page).to have_checked_field('checkbox')
|
||||
expect(page).to have_checked_field('Madame')
|
||||
|
|
|
@ -479,9 +479,9 @@ describe Dossier do
|
|||
end
|
||||
|
||||
context 'when they are a lot of advice' do
|
||||
let!(:avis_1) { Avis.create(dossier: dossier, claimant: expert_1, gestionnaire: expert_2, confidentiel: false, created_at: DateTime.parse('10/01/2010')) }
|
||||
let!(:avis_2) { Avis.create(dossier: dossier, claimant: expert_1, gestionnaire: expert_2, confidentiel: false, created_at: DateTime.parse('9/01/2010')) }
|
||||
let!(:avis_3) { Avis.create(dossier: dossier, claimant: expert_1, gestionnaire: expert_2, confidentiel: false, created_at: DateTime.parse('11/01/2010')) }
|
||||
let!(:avis_1) { Avis.create(dossier: dossier, claimant: expert_1, gestionnaire: expert_2, confidentiel: false, created_at: Time.zone.parse('10/01/2010')) }
|
||||
let!(:avis_2) { Avis.create(dossier: dossier, claimant: expert_1, gestionnaire: expert_2, confidentiel: false, created_at: Time.zone.parse('9/01/2010')) }
|
||||
let!(:avis_3) { Avis.create(dossier: dossier, claimant: expert_1, gestionnaire: expert_2, confidentiel: false, created_at: Time.zone.parse('11/01/2010')) }
|
||||
|
||||
it { expect(dossier.avis_for(gestionnaire)).to match([avis_2, avis_1, avis_3]) }
|
||||
it { expect(dossier.avis_for(expert_1)).to match([avis_2, avis_1, avis_3]) }
|
||||
|
@ -566,9 +566,9 @@ describe Dossier do
|
|||
describe '.downloadable_sorted' do
|
||||
let(:procedure) { create(:procedure) }
|
||||
let!(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:brouillon)) }
|
||||
let!(:dossier2) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:en_construction), en_construction_at: DateTime.parse('03/01/2010')) }
|
||||
let!(:dossier3) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:en_instruction), en_construction_at: DateTime.parse('01/01/2010')) }
|
||||
let!(:dossier4) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:en_instruction), archived: true, en_construction_at: DateTime.parse('02/01/2010')) }
|
||||
let!(:dossier2) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:en_construction), en_construction_at: Time.zone.parse('03/01/2010')) }
|
||||
let!(:dossier3) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:en_instruction), en_construction_at: Time.zone.parse('01/01/2010')) }
|
||||
let!(:dossier4) { create(:dossier, :with_entreprise, procedure: procedure, state: Dossier.states.fetch(:en_instruction), archived: true, en_construction_at: Time.zone.parse('02/01/2010')) }
|
||||
|
||||
subject { procedure.dossiers.downloadable_sorted }
|
||||
|
||||
|
@ -734,7 +734,7 @@ describe Dossier do
|
|||
|
||||
describe 'updated_at' do
|
||||
let!(:dossier) { create(:dossier) }
|
||||
let(:modif_date) { DateTime.parse('01/01/2100') }
|
||||
let(:modif_date) { Time.zone.parse('01/01/2100') }
|
||||
|
||||
before { Timecop.freeze(modif_date) }
|
||||
after { Timecop.return }
|
||||
|
@ -985,7 +985,7 @@ describe Dossier do
|
|||
let(:young_dossier) { create(:dossier, :en_instruction, en_instruction_at: Time.zone.now, procedure: procedure) }
|
||||
let(:just_expired_dossier) { create(:dossier, :en_instruction, en_instruction_at: 6.months.ago, procedure: procedure) }
|
||||
let(:long_expired_dossier) { create(:dossier, :en_instruction, en_instruction_at: 1.year.ago, procedure: procedure) }
|
||||
let(:modif_date) { DateTime.parse('01/01/2100') }
|
||||
let(:modif_date) { Time.zone.parse('01/01/2100') }
|
||||
|
||||
before { Timecop.freeze(modif_date) }
|
||||
after { Timecop.return }
|
||||
|
|
|
@ -376,7 +376,7 @@ describe Gestionnaire, type: :model do
|
|||
describe '#mark_tab_as_seen' do
|
||||
let!(:dossier) { create(:dossier, :followed, state: Dossier.states.fetch(:en_construction)) }
|
||||
let(:gestionnaire) { dossier.follows.first.gestionnaire }
|
||||
let(:freeze_date) { DateTime.parse('12/12/2012') }
|
||||
let(:freeze_date) { Time.zone.parse('12/12/2012') }
|
||||
|
||||
context 'when demande is acknowledged' do
|
||||
let(:follow) { gestionnaire.follows.find_by(dossier: dossier) }
|
||||
|
|
|
@ -716,7 +716,7 @@ describe Procedure do
|
|||
context 'which is termine' do
|
||||
before do
|
||||
dossier.accepte!
|
||||
processed_date = DateTime.parse('12/12/2012')
|
||||
processed_date = Time.zone.parse('12/12/2012')
|
||||
instruction_date = processed_date - 1.day
|
||||
dossier.update(en_instruction_at: instruction_date, processed_at: processed_date)
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ describe FranceConnectService do
|
|||
expect(subject).to have_attributes({
|
||||
given_name: given_name,
|
||||
family_name: family_name,
|
||||
birthdate: DateTime.parse(birthdate),
|
||||
birthdate: Time.zone.parse(birthdate),
|
||||
birthplace: birthplace,
|
||||
gender: gender,
|
||||
email_france_connect: email,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue