From 9bc6ef2783a36d35c1f0adcbc49176c4398ff057 Mon Sep 17 00:00:00 2001 From: Konstantin Gredeskoul Date: Sun, 1 Dec 2024 19:32:43 -0800 Subject: [PATCH] Upgrade gems + fix broken specs b/c due to PDT * Two specs were only working in PST, but not in PDT. * After day-light savings kicked into effect, they started failing --- Gemfile.lock | 108 +++++++++++++++---------------- spec/helpers/time_helper_spec.rb | 5 +- spec/models/event_spec.rb | 7 +- 3 files changed, 61 insertions(+), 59 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a87edd05..abdb6dce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GEM remote: https://rubygems.org/ specs: - accept_values_for (0.9.3) - activemodel (>= 6.1, < 8.0) + accept_values_for (0.9.5) + activemodel (>= 6.1, < 8.1) rspec (>= 3.10, < 4.0) actioncable (8.0.0.beta1) actionpack (= 8.0.0.beta1) @@ -91,7 +91,7 @@ GEM bcrypt_pbkdf (1.1.1) bcrypt_pbkdf (1.1.1-arm64-darwin) bcrypt_pbkdf (1.1.1-x86_64-darwin) - benchmark (0.3.0) + benchmark (0.4.0) better_errors (2.10.1) erubi (>= 1.0.0) rack (>= 0.9.0) @@ -102,10 +102,10 @@ GEM debug_inspector (>= 1.2.0) bootsnap (1.18.4) msgpack (~> 1.2) - brakeman (6.2.1) + brakeman (6.2.2) racc builder (3.3.0) - capistrano (3.19.1) + capistrano (3.19.2) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) @@ -148,10 +148,10 @@ GEM railties (>= 6.0.0) csv (3.3.0) dalli (3.2.8) - data_migrate (11.0.0) + data_migrate (11.2.0) activerecord (>= 6.1) railties (>= 6.1) - date (3.3.4) + date (3.4.0) debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) @@ -169,10 +169,10 @@ GEM erubi (1.13.0) factory_bot (6.5.0) activesupport (>= 5.0.0) - factory_bot_rails (6.4.3) - factory_bot (~> 6.4) + factory_bot_rails (6.4.4) + factory_bot (~> 6.5) railties (>= 5.0.0) - faker (3.4.2) + faker (3.5.1) i18n (>= 1.8.11, < 2) flatpickr (4.6.13.1) foreman (0.88.1) @@ -187,7 +187,7 @@ GEM activesupport (>= 5.1) haml (>= 4.0.6) railties (>= 5.1) - hashdiff (1.1.1) + hashdiff (1.1.2) hashie (5.0.0) i18n (1.14.6) concurrent-ruby (~> 1.0) @@ -200,7 +200,7 @@ GEM activesupport (>= 5.0.0) jsbundling-rails (1.3.1) railties (>= 6.0.0) - json (2.7.2) + json (2.8.2) language_server-protocol (3.17.0.3) logger (1.6.1) lograge (0.14.0) @@ -209,7 +209,7 @@ GEM railties (>= 4) request_store (~> 1.0) logstash-event (1.2.02) - loofah (2.22.0) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -221,13 +221,13 @@ GEM mime-types (3.6.0) logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.1001) + mime-types-data (3.2024.1105) mini_magick (5.0.1) mini_mime (1.1.5) - minitest (5.25.1) - msgpack (1.7.2) + minitest (5.25.2) + msgpack (1.7.5) multi_json (1.15.0) - net-imap (0.4.16) + net-imap (0.5.1) date net-protocol net-pop (0.1.2) @@ -242,8 +242,8 @@ GEM net-protocol net-ssh (7.3.0) net_http_unix (0.2.2) - newrelic_rpm (9.14.0) - nio4r (2.7.3) + newrelic_rpm (9.16.0) + nio4r (2.7.4) nokogiri (1.16.7-aarch64-linux) racc (~> 1.4) nokogiri (1.16.7-arm-linux) @@ -257,14 +257,14 @@ GEM nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) - ostruct (0.6.0) + ostruct (0.6.1) parallel (1.26.3) paranoia (3.0.0) activerecord (>= 6, < 8.1) - parser (3.3.5.0) + parser (3.3.6.0) ast (~> 2.4.1) racc - pg (1.5.8) + pg (1.5.9) propshaft (1.1.0) actionpack (>= 7.0.0) activesupport (>= 7.0.0) @@ -272,23 +272,22 @@ GEM railties (>= 7.0.0) protected_attributes_continued (1.9.0) activemodel (>= 5.0) - psych (5.1.2) + psych (5.2.0) stringio public_suffix (6.0.1) - puma (6.4.3) + puma (6.5.0) nio4r (~> 2.0) puma-status (1.7) net_http_unix (~> 0.2) parallel (~> 1) racc (1.8.1) - rack (3.1.7) + rack (3.1.8) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (2.1.0) + rackup (2.2.1) rack (>= 3) - webrick (~> 1.8) rails (8.0.0.beta1) actioncable (= 8.0.0.beta1) actionmailbox (= 8.0.0.beta1) @@ -320,39 +319,39 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.7.0) + rdoc (6.8.1) psych (>= 4.0.0) redis (5.3.0) redis-client (>= 0.22.0) redis-client (0.22.2) connection_pool - regexp_parser (2.9.2) + regexp_parser (2.9.3) relaxed-rubocop (2.5) - reline (0.5.10) + reline (0.5.12) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.8) - rouge (4.4.0) + rexml (3.3.9) + rouge (4.5.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.1) + rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-its (1.3.0) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) + rspec-its (2.0.0) + rspec-core (>= 3.13.0) + rspec-expectations (>= 3.13.0) rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (7.0.1) + rspec-rails (7.1.0) actionpack (>= 7.0) activesupport (>= 7.0) railties (>= 7.0) @@ -361,25 +360,25 @@ GEM rspec-mocks (~> 3.13) rspec-support (~> 3.13) rspec-support (3.13.1) - rubocop (1.66.1) + rubocop (1.69.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) + rubocop-ast (>= 1.36.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.36.2) parser (>= 3.3.1.0) rubocop-minitest (0.36.0) rubocop (>= 1.61, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-performance (1.22.1) + rubocop-performance (1.23.0) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.26.2) + rubocop-rails (2.27.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.52.0, < 2.0) @@ -391,17 +390,17 @@ GEM rubocop-rails rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (3.1.0) + rubocop-rspec (3.2.0) rubocop (~> 1.61) ruby-progressbar (1.13.0) - securerandom (0.3.1) + securerandom (0.3.2) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) - sshkit (1.23.1) + sshkit (1.23.2) base64 net-scp (>= 1.1.2) net-sftp (>= 2.1.2) @@ -410,21 +409,23 @@ GEM ssrf_filter (1.0.8) stimulus-rails (1.3.4) railties (>= 6.0.0) - stringio (3.1.1) + stringio (3.1.2) stripe (11.7.0) temple (0.10.3) thor (1.3.2) tilt (2.4.0) timecop (0.9.10) - timeout (0.4.1) - turbo-rails (2.0.10) + timeout (0.4.2) + turbo-rails (2.0.11) actionpack (>= 6.0.0) railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unaccent (0.4.0) - unicode-display_width (2.6.0) - uri (0.13.1) + unicode-display_width (3.1.2) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uri (1.0.2) useragent (0.16.10) vcr (6.3.1) base64 @@ -441,12 +442,11 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.8.2) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) yard (0.9.37) - zeitwerk (2.6.18) + zeitwerk (2.7.1) PLATFORMS aarch64-linux @@ -534,4 +534,4 @@ RUBY VERSION ruby 3.3.5p100 BUNDLED WITH - 2.5.16 + 2.5.23 diff --git a/spec/helpers/time_helper_spec.rb b/spec/helpers/time_helper_spec.rb index 0c2bd7d9..29b6496c 100644 --- a/spec/helpers/time_helper_spec.rb +++ b/spec/helpers/time_helper_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' RSpec.describe TimeHelper do - let(:valid_input) { '04/20/2024, 4:20 PM' } + let(:valid_input) { '04/20/2024, 4:20 PM -0700' } describe '.to_flatpickr' do let(:date) { DateTime.new(2024, 4, 20, 8, 37, 48, -7) } @@ -40,7 +40,8 @@ describe '.normalize_time_attributes' do let(:test_hash) { { start_time: valid_input } } - let(:date_epoch_string) { DateTime.parse('2024-04-20T16:20:00 -0700').to_time.to_i } + let(:date_epoch) { '2024-04-20T16:20:00 -0700' } + let(:date_epoch_string) { DateTime.parse(date_epoch).to_time.to_i } describe 'empty arguments' do subject { described_class.normalize_time_attributes(input) } diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 80550238..24b37776 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -58,12 +58,13 @@ end describe 'event title' do - let(:params) { { start_time: TimeHelper.from_flatpickr('10/1/2030, 12:00 PM') } } + # Must use UTC timezone to avoid day-light-savings off by one failure + let(:params) { { start_time: TimeHelper.from_flatpickr('10/1/2030, 12:00 PM UTC') } } describe '#starting' do - subject { event.starting } + subject { event.starting.to_s } - it { is_expected.to eq 'Tuesday, October 1, 2030 @ 12:00 PM' } + it { is_expected.to eq "Tuesday, October 1, 2030 @ 05:00 AM" } end describe '#long_name' do