From 64d0258d481af876db4eb0adb8c54efe0bd2200a Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Wed, 28 Aug 2024 21:41:46 +0200 Subject: [PATCH] Set dummy app time_zone to Berlin In order to test timezone based features and issues it makes sense to use a different one than UTC. --- spec/dummy/config/application.rb | 1 + spec/libraries/forms/builder_spec.rb | 4 ++-- spec/models/alchemy/page_spec.rb | 6 +++--- spec/serializers/alchemy/element_serializer_spec.rb | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 0e1bb36d4d..ac622eea8d 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -30,5 +30,6 @@ class Application < Rails::Application # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. + config.time_zone = "Berlin" end end diff --git a/spec/libraries/forms/builder_spec.rb b/spec/libraries/forms/builder_spec.rb index 243b16e7e8..0cf3228a70 100644 --- a/spec/libraries/forms/builder_spec.rb +++ b/spec/libraries/forms/builder_spec.rb @@ -50,7 +50,7 @@ it_behaves_like "datepicker expect" do let(:type) { :date } - let(:value) { "2021-07-14T00:00:00Z" } + let(:value) { "2021-07-14T00:00:00+02:00" } end end @@ -59,7 +59,7 @@ it_behaves_like "datepicker expect" do let(:type) { :date } - let(:value) { "2021-08-01T00:00:00Z" } + let(:value) { "2021-08-01T00:00:00+02:00" } end end end diff --git a/spec/models/alchemy/page_spec.rb b/spec/models/alchemy/page_spec.rb index aa6a4b88d1..1f67f29ac5 100644 --- a/spec/models/alchemy/page_spec.rb +++ b/spec/models/alchemy/page_spec.rb @@ -720,7 +720,7 @@ module Alchemy end it "returns a cache version string" do - expect(page.cache_version).to eq("2018-12-31 12:00:00 UTC") + expect(page.cache_version).to eq("2018-12-31 13:00:00 +0100") end end @@ -1479,7 +1479,7 @@ module Alchemy end it "returns value" do - is_expected.to eq("2016-11-01".to_time(:utc)) + is_expected.to eq("2016-11-01".to_time) end end end @@ -1504,7 +1504,7 @@ module Alchemy end it "returns public_until from public version" do - is_expected.to eq("2016-11-01".to_time(:utc)) + is_expected.to eq("2016-11-01".to_time) end end diff --git a/spec/serializers/alchemy/element_serializer_spec.rb b/spec/serializers/alchemy/element_serializer_spec.rb index 1f8c0f25e0..8f54f90519 100644 --- a/spec/serializers/alchemy/element_serializer_spec.rb +++ b/spec/serializers/alchemy/element_serializer_spec.rb @@ -10,7 +10,7 @@ it "includes all attributes" do json = JSON.parse(subject) expect(json).to eq( - "created_at" => element.created_at.strftime("%FT%T.%LZ"), + "created_at" => element.created_at.strftime("%FT%T.%L+02:00"), "display_name" => element.display_name_with_preview_text, "dom_id" => element.dom_id, "id" => element.id, @@ -21,7 +21,7 @@ "page_version_id" => element.page_version_id, "position" => 1, "tag_list" => [], - "updated_at" => element.updated_at.strftime("%FT%T.%LZ") + "updated_at" => element.updated_at.strftime("%FT%T.%L+02:00") ) end end