From 37fca065bbe7202f48cb014dcc2beafb0b151150 Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Mon, 26 Mar 2018 12:28:44 +0200 Subject: Use utc time to make expectation with strftime (when timezone are not standard). Refs #6047 --- spec/models/export/base_spec.rb | 4 ++-- spec/models/import/import_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/models/export/base_spec.rb b/spec/models/export/base_spec.rb index 9faf31e38..3d10ecead 100644 --- a/spec/models/export/base_spec.rb +++ b/spec/models/export/base_spec.rb @@ -129,8 +129,8 @@ RSpec.describe Export::Base, type: :model do Timecop.freeze(Time.now) do netex_export.notify_parent - expect(netex_export.notified_parent_at.strftime('%Y-%m-%d %H:%M:%S.%3N')).to eq Time.now.strftime('%Y-%m-%d %H:%M:%S.%3N') - expect(netex_export.reload.notified_parent_at.strftime('%Y-%m-%d %H:%M:%S.%3N')).to eq Time.now.strftime('%Y-%m-%d %H:%M:%S.%3N') + expect(netex_export.notified_parent_at.utc.strftime('%Y-%m-%d %H:%M:%S.%3N')).to eq Time.now.utc.strftime('%Y-%m-%d %H:%M:%S.%3N') + expect(netex_export.reload.notified_parent_at.utc.strftime('%Y-%m-%d %H:%M:%S.%3N')).to eq Time.now.utc.strftime('%Y-%m-%d %H:%M:%S.%3N') end end end diff --git a/spec/models/import/import_spec.rb b/spec/models/import/import_spec.rb index 73670b60f..b11c4922c 100644 --- a/spec/models/import/import_spec.rb +++ b/spec/models/import/import_spec.rb @@ -128,8 +128,8 @@ RSpec.describe Import::Base, type: :model do allow(workbench_import).to receive(:child_change) Timecop.freeze(Time.now) do netex_import.notify_parent - expect(netex_import.notified_parent_at.strftime('%Y-%m-%d %H:%M:%S.%3N')).to eq Time.now.strftime('%Y-%m-%d %H:%M:%S.%3N') - expect(netex_import.reload.notified_parent_at.strftime('%Y-%m-%d %H:%M:%S.%3N')).to eq Time.now.strftime('%Y-%m-%d %H:%M:%S.%3N') + expect(netex_import.notified_parent_at.utc.strftime('%Y-%m-%d %H:%M:%S.%3N')).to eq Time.now.utc.strftime('%Y-%m-%d %H:%M:%S.%3N') + expect(netex_import.reload.notified_parent_at.utc.strftime('%Y-%m-%d %H:%M:%S.%3N')).to eq Time.now.utc.strftime('%Y-%m-%d %H:%M:%S.%3N') end end end -- cgit v1.2.3