From 88ee3e5cbe7754670fe7e51829a7c4703abdc481 Mon Sep 17 00:00:00 2001 From: guswhitten Date: Mon, 29 Apr 2024 08:21:08 -0400 Subject: [PATCH 1/5] add case_contact_presenter_spec.rb to test functionality of CaseContactPresenter class --- .allow_skipping_tests | 1 - Gemfile.lock | 164 ++++++++---------- app/presenters/case_contact_presenter.rb | 4 +- .../presenters/case_contact_presenter_spec.rb | 45 +++++ 4 files changed, 120 insertions(+), 94 deletions(-) create mode 100644 spec/presenters/case_contact_presenter_spec.rb diff --git a/.allow_skipping_tests b/.allow_skipping_tests index 72251df04a..a92d8b94a8 100644 --- a/.allow_skipping_tests +++ b/.allow_skipping_tests @@ -39,7 +39,6 @@ policies/learning_hour_topic_policy.rb policies/learning_hour_type_policy.rb policies/note_policy.rb presenters/base_presenter.rb -presenters/case_contact_presenter.rb services/case_contacts_export_csv_service.rb services/court_report_format_contact_date.rb services/create_all_casa_admin_service.rb diff --git a/Gemfile.lock b/Gemfile.lock index 90fb9a2c25..47b66f2131 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -79,7 +79,7 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) after_party (1.11.2) amazing_print (1.6.0) @@ -97,7 +97,7 @@ GEM nokogiri (~> 1, >= 1.10.8) base64 (0.1.1) bcrypt (3.1.20) - better_html (2.0.2) + better_html (2.1.1) actionview (>= 6.0) activesupport (>= 6.0) ast (~> 2.0) @@ -106,7 +106,7 @@ GEM smart_properties bigdecimal (3.1.7) bindex (0.8.1) - blueprinter (0.30.0) + blueprinter (1.0.2) brakeman (6.1.2) racc bugsnag (6.26.4) @@ -143,7 +143,8 @@ GEM coderay (1.1.3) concurrent-ruby (1.2.3) connection_pool (2.4.1) - crack (0.4.5) + crack (1.0.0) + bigdecimal rexml crass (1.0.6) cssbundling-rails (1.4.0) @@ -158,7 +159,7 @@ GEM delayed_job_active_record (4.1.8) activerecord (>= 3.0, < 8.0) delayed_job (>= 3.0, < 5) - devise (4.9.3) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -167,17 +168,15 @@ GEM devise_invitable (2.0.9) actionmailer (>= 5.0) devise (>= 4.6) - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.4.0) docx (0.8.0) nokogiri (~> 1.13, >= 1.13.0) rubyzip (~> 2.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.8.1) - dotenv-rails (2.8.1) - dotenv (= 2.8.1) - railties (>= 3.2) + dotenv (3.1.0) + dotenv-rails (3.1.0) + dotenv (= 3.1.0) + railties (>= 6.1) draper (4.0.2) actionpack (>= 5.0) activemodel (>= 5.0) @@ -198,7 +197,7 @@ GEM rubocop smart_properties erubi (1.12.0) - factory_bot (6.4.5) + factory_bot (6.4.6) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) @@ -230,10 +229,7 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - ffi (1.15.5) - ffi-compiler (1.0.1) - ffi (>= 1.0.0) - rake + ffi (1.16.3) filterrific (5.2.5) friendly_id (5.5.1) activerecord (>= 4.0.0) @@ -241,16 +237,8 @@ GEM activesupport (>= 6.1) groupdate (6.4.0) activesupport (>= 6.1) - hashdiff (1.0.1) + hashdiff (1.1.0) htmlentities (4.3.4) - http (5.1.1) - addressable (~> 2.8) - http-cookie (~> 1.0) - http-form_data (~> 2.2) - llhttp-ffi (~> 0.4.0) - http-cookie (1.0.5) - domain_name (~> 0.5) - http-form_data (2.3.0) httparty (0.21.0) mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) @@ -263,24 +251,22 @@ GEM irb (1.12.0) rdoc reline (>= 0.4.2) - jbuilder (2.11.5) + jbuilder (2.12.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) jsbundling-rails (1.3.0) railties (>= 6.0.0) - json (2.6.3) - json-schema (4.1.1) + json (2.7.2) + json-schema (4.3.0) addressable (>= 2.8) - jwt (2.7.1) + jwt (2.8.1) + base64 language_server-protocol (3.17.0.3) - launchy (2.5.0) - addressable (~> 2.7) - letter_opener (1.9.0) - launchy (>= 2.2, < 3) + launchy (2.5.2) + addressable (~> 2.8) + letter_opener (1.10.0) + launchy (>= 2.2, < 4) lint_roller (1.1.0) - llhttp-ffi (0.4.0) - ffi-compiler (~> 1.0) - rake (~> 13.0) lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) @@ -296,17 +282,17 @@ GEM net-smtp marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) - mini_magick (4.11.0) + method_source (1.1.0) + mini_magick (4.12.0) mini_mime (1.1.5) mini_portile2 (2.8.6) minitest (5.22.3) multi_xml (0.6.0) - multipart-post (2.3.0) + multipart-post (2.4.0) mutex_m (0.2.0) - net-http-persistent (4.0.1) + net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-imap (0.4.9) + net-imap (0.4.10) date net-protocol net-pop (0.1.2) @@ -325,23 +311,22 @@ GEM racc (~> 1.4) nokogiri (1.16.4-x86_64-linux) racc (~> 1.4) - noticed (1.6.3) - http (>= 4.0.0) - rails (>= 5.2.0) + noticed (2.2.2) + rails (>= 6.1.0) oj (3.16.3) bigdecimal (>= 3.0) orm_adapter (0.5.0) - parallel (1.23.0) + parallel (1.24.0) paranoia (2.6.3) activerecord (>= 5.1, < 7.2) - parser (3.2.2.3) + parser (3.3.1.0) ast (~> 2.4.1) racc pdf-forms (1.5.0) cliver (~> 0.3.2) rexml (~> 3.2, >= 3.2.6) safe_shell (>= 1.0.3, < 2.0) - pg (1.5.4) + pg (1.5.6) pretender (0.5.0) actionpack (>= 6.1) pry (0.14.2) @@ -352,24 +337,24 @@ GEM pry (>= 0.13, < 0.15) psych (5.1.2) stringio - public_suffix (5.0.4) + public_suffix (5.0.5) puma (6.4.2) nio4r (~> 2.0) pundit (2.3.1) activesupport (>= 3.0.0) racc (1.7.3) - rack (2.2.9) + rack (3.0.10) rack-attack (6.7.0) rack (>= 1.0, < 4) - rack-cors (2.0.1) + rack-cors (2.0.2) rack (>= 2.0.0) - rack-session (1.0.2) - rack (< 3) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (1.0.0) - rack (< 3) - webrick + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) rails (7.1.3.2) actioncable (= 7.1.3.2) actionmailbox (= 7.1.3.2) @@ -404,11 +389,11 @@ GEM thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.1) rdoc (6.6.3.1) psych (>= 4.0.0) - regexp_parser (2.8.1) - reline (0.5.0) + regexp_parser (2.9.0) + reline (0.5.3) io-console (~> 0.5) request_store (1.6.0) rack (>= 1.4) @@ -416,23 +401,23 @@ GEM actionpack (>= 5.2) railties (>= 5.2) rexml (3.2.6) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.1.1) + rspec-support (~> 3.13.0) + rspec-rails (6.1.2) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) - rspec-support (3.12.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) rswag-api (2.13.0) activesupport (>= 3.1, < 7.2) railties (>= 3.1, < 7.2) @@ -456,21 +441,21 @@ GEM rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-performance (1.20.2) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (1.13.0) - ruby-vips (2.1.4) + ruby-vips (2.2.1) ffi (~> 1.12) ruby2_keywords (0.0.5) rubyzip (2.3.2) - sablon (0.3.2) + sablon (0.4.0) nokogiri (>= 1.8.5) - rubyzip (>= 1.1.1) + rubyzip (>= 1.3.0) safe_shell (1.1.0) - scout_apm (5.3.5) + scout_apm (5.3.8) parser selenium-webdriver (4.16.0) rexml (~> 3.2, >= 3.2.5) @@ -485,12 +470,12 @@ GEM simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) smart_properties (1.17.0) - spring (4.2.0) + spring (4.2.1) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - sprockets (4.1.1) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) @@ -504,9 +489,9 @@ GEM standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.2.1) + standard-performance (1.3.1) lint_roller (~> 1.1) - rubocop-performance (~> 1.19.1) + rubocop-performance (~> 1.20.2) stimulus-rails (1.3.3) railties (>= 6.0.0) stringio (3.1.0) @@ -516,18 +501,15 @@ GEM timeout (0.4.1) traceroute (0.8.1) rails (>= 3.0.0) - twilio-ruby (6.9.1) + twilio-ruby (7.0.2) faraday (>= 0.9, < 3.0) jwt (>= 1.5, < 3.0) nokogiri (>= 1.6, < 2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) uniform_notifier (1.16.0) - view_component (3.9.0) + view_component (3.12.1) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) diff --git a/app/presenters/case_contact_presenter.rb b/app/presenters/case_contact_presenter.rb index c4c2e886be..1f1a80fdc5 100644 --- a/app/presenters/case_contact_presenter.rb +++ b/app/presenters/case_contact_presenter.rb @@ -8,8 +8,8 @@ def initialize(case_contacts) end def display_case_number(casa_case_id) - if casa_case_id - "#{casa_cases[casa_case_id]&.decorate&.transition_aged_youth_icon} #{casa_cases[casa_case_id]&.case_number}" + if casa_cases[casa_case_id]&.case_number.present? + "#{casa_cases[casa_case_id].decorate.transition_aged_youth_icon} #{casa_cases[casa_case_id].case_number}" else "" end diff --git a/spec/presenters/case_contact_presenter_spec.rb b/spec/presenters/case_contact_presenter_spec.rb new file mode 100644 index 0000000000..a112477a19 --- /dev/null +++ b/spec/presenters/case_contact_presenter_spec.rb @@ -0,0 +1,45 @@ +require "rails_helper" + +RSpec.describe CaseContactPresenter do + let(:organization) { build(:casa_org) } + let(:user) { create(:casa_admin, casa_org: organization) } + let(:case_contacts) { create_list(:case_contact, 5, casa_case: casa_case) } + let(:presenter) { described_class.new(case_contacts) } + + before do + allow_any_instance_of(described_class).to receive(:current_user).and_return(user) + allow_any_instance_of(described_class).to receive(:current_organization).and_return(organization) + end + + describe '#display_case_number' do + context 'with transition aged youth' do + let(:casa_case) { create(:casa_case, birth_month_year_youth: 15.years.ago, casa_org: organization) } + + it 'displays the case number with correct icon' do + casa_case_id = casa_case.id + case_number = casa_case.case_number + + expect(presenter.display_case_number(casa_case_id)).to eql("🦋 #{case_number}") + end + + it 'does not error when case number is nil' do + expect(presenter.display_case_number(nil)).to eql('') + end + end + + context 'with non-transition aged youth' do + let(:casa_case) { create(:casa_case, birth_month_year_youth: 12.years.ago, casa_org: organization) } + + it 'displays the case number with correct icon' do + casa_case_id = casa_case.id + case_number = casa_case.case_number + + expect(presenter.display_case_number(casa_case_id)).to eql("🐛 #{case_number}") + end + + it 'does not error when case number is nil' do + expect(presenter.display_case_number(nil)).to eql('') + end + end + end +end From 4d9e95421b99d0320f5a07a03bd87aaf61ca0520 Mon Sep 17 00:00:00 2001 From: guswhitten Date: Mon, 29 Apr 2024 21:30:03 -0400 Subject: [PATCH 2/5] tests for application_controller store_referring_location --- .../application_controller_spec.rb | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 37d41faa45..d1ce1eb5a9 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -19,6 +19,10 @@ def handle_short_url(url_list) super end + def store_referring_location + super + end + def not_authorized_error raise Pundit::NotAuthorizedError end @@ -115,4 +119,24 @@ def unknown_organization expect(controller.send(:sms_acct_creation_notice, "admin", "sent")).to eq("New admin created successfully. SMS has been sent!") end end -end + + describe "#store_referring_location" do + it 'stores referring location in session if referer is present and not sign in page' do + request.env['HTTP_REFERER'] = 'http://example.com' + controller.store_referring_location + expect(session[:return_to]).to eq('http://example.com') + end + + it 'does not store referring location if referer is sign in page' do + request.env['HTTP_REFERER'] = 'http://example.com/users/sign_in' + controller.store_referring_location + expect(session[:return_to]).to be_nil + end + + it 'does not store referring location if referer is not present' do + request.env['HTTP_REFERER'] = nil + controller.store_referring_location + expect(session[:return_to]).to be_nil + end + end +end \ No newline at end of file From d15a999f1c7bec072f452d78d234bc2c7bbb1418 Mon Sep 17 00:00:00 2001 From: guswhitten Date: Mon, 29 Apr 2024 21:56:12 -0400 Subject: [PATCH 3/5] fix noticed gem during bundle update --- Gemfile | 2 +- Gemfile.lock | 57 ++++++++++++------- .../application_controller_spec.rb | 2 +- .../presenters/case_contact_presenter_spec.rb | 2 +- 4 files changed, 40 insertions(+), 23 deletions(-) diff --git a/Gemfile b/Gemfile index bf7c662e5e..245ba201ed 100644 --- a/Gemfile +++ b/Gemfile @@ -28,7 +28,7 @@ gem "lograge" # log less so heroku papertrail quits rate limiting our logs gem "net-smtp", require: false # needed for ruby upgrade to 3.1.0 for some dang reason gem "net-pop" # needed for ruby upgrade to 3.1.0 https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/ gem "net-imap" # needed for ruby upgrade to 3.1.0 https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/ -gem "noticed" # Notifications +gem "noticed", "~> 1.6.0" # Notifications gem "view_component" # View components for reusability gem "paranoia" # For soft-deleting database objects gem "pdf-forms" # filling in fund request PDFs with user input diff --git a/Gemfile.lock b/Gemfile.lock index 47b66f2131..edf54a2929 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -149,6 +149,7 @@ GEM crass (1.0.6) cssbundling-rails (1.4.0) railties (>= 6.0.0) + csv (3.3.0) database_cleaner-active_record (2.1.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) @@ -173,6 +174,7 @@ GEM docx (0.8.0) nokogiri (~> 1.13, >= 1.13.0) rubyzip (~> 2.0) + domain_name (0.6.20240107) dotenv (3.1.0) dotenv-rails (3.1.0) dotenv (= 3.1.0) @@ -230,6 +232,9 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) ffi (1.16.3) + ffi-compiler (1.3.2) + ffi (>= 1.15.5) + rake filterrific (5.2.5) friendly_id (5.5.1) activerecord (>= 4.0.0) @@ -239,7 +244,17 @@ GEM activesupport (>= 6.1) hashdiff (1.1.0) htmlentities (4.3.4) - httparty (0.21.0) + http (5.2.0) + addressable (~> 2.8) + base64 (~> 0.1) + http-cookie (~> 1.0) + http-form_data (~> 2.2) + llhttp-ffi (~> 0.5.0) + http-cookie (1.0.5) + domain_name (~> 0.5) + http-form_data (2.3.0) + httparty (0.22.0) + csv mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) i18n (1.14.4) @@ -267,6 +282,9 @@ GEM letter_opener (1.10.0) launchy (>= 2.2, < 4) lint_roller (1.1.0) + llhttp-ffi (0.5.0) + ffi-compiler (~> 1.0) + rake (~> 13.0) lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) @@ -285,7 +303,6 @@ GEM method_source (1.1.0) mini_magick (4.12.0) mini_mime (1.1.5) - mini_portile2 (2.8.6) minitest (5.22.3) multi_xml (0.6.0) multipart-post (2.4.0) @@ -302,17 +319,21 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.1) - nokogiri (1.16.4) - mini_portile2 (~> 2.8.2) + nokogiri (1.16.4-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.4-arm-linux) racc (~> 1.4) nokogiri (1.16.4-arm64-darwin) racc (~> 1.4) + nokogiri (1.16.4-x86-linux) + racc (~> 1.4) nokogiri (1.16.4-x86_64-darwin) racc (~> 1.4) nokogiri (1.16.4-x86_64-linux) racc (~> 1.4) - noticed (2.2.2) - rails (>= 6.1.0) + noticed (1.6.3) + http (>= 4.0.0) + rails (>= 5.2.0) oj (3.16.3) bigdecimal (>= 3.0) orm_adapter (0.5.0) @@ -393,7 +414,7 @@ GEM rdoc (6.6.3.1) psych (>= 4.0.0) regexp_parser (2.9.0) - reline (0.5.3) + reline (0.5.4) io-console (~> 0.5) request_store (1.6.0) rack (>= 1.4) @@ -441,8 +462,8 @@ GEM rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) rubocop-performance (1.20.2) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) @@ -536,15 +557,11 @@ GEM zeitwerk (2.6.13) PLATFORMS - arm64-darwin-20 - arm64-darwin-21 - arm64-darwin-22 - ruby - x86_64-darwin-18 - x86_64-darwin-19 - x86_64-darwin-20 - x86_64-darwin-21 - x86_64-darwin-22 + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin x86_64-linux DEPENDENCIES @@ -586,7 +603,7 @@ DEPENDENCIES net-imap net-pop net-smtp - noticed + noticed (~> 1.6.0) oj paranoia pdf-forms @@ -630,4 +647,4 @@ RUBY VERSION ruby 3.2.2p53 BUNDLED WITH - 2.4.22 + 2.5.9 diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index d1ce1eb5a9..d455a3c44f 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -139,4 +139,4 @@ def unknown_organization expect(session[:return_to]).to be_nil end end -end \ No newline at end of file +end diff --git a/spec/presenters/case_contact_presenter_spec.rb b/spec/presenters/case_contact_presenter_spec.rb index a112477a19..068a54e20b 100644 --- a/spec/presenters/case_contact_presenter_spec.rb +++ b/spec/presenters/case_contact_presenter_spec.rb @@ -29,7 +29,7 @@ context 'with non-transition aged youth' do let(:casa_case) { create(:casa_case, birth_month_year_youth: 12.years.ago, casa_org: organization) } - + it 'displays the case number with correct icon' do casa_case_id = casa_case.id case_number = casa_case.case_number From c4b30d31c5982e9aa808eea8ac99bfae3a9c65c4 Mon Sep 17 00:00:00 2001 From: guswhitten Date: Mon, 29 Apr 2024 22:03:13 -0400 Subject: [PATCH 4/5] rollback bundle update and standardrb --fix linting --- Gemfile.lock | 185 +++++++++--------- .../application_controller_spec.rb | 14 +- .../presenters/case_contact_presenter_spec.rb | 18 +- 3 files changed, 109 insertions(+), 108 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index edf54a2929..d12e9ceef7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -79,7 +79,7 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.6) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) after_party (1.11.2) amazing_print (1.6.0) @@ -97,7 +97,7 @@ GEM nokogiri (~> 1, >= 1.10.8) base64 (0.1.1) bcrypt (3.1.20) - better_html (2.1.1) + better_html (2.0.2) actionview (>= 6.0) activesupport (>= 6.0) ast (~> 2.0) @@ -106,7 +106,7 @@ GEM smart_properties bigdecimal (3.1.7) bindex (0.8.1) - blueprinter (1.0.2) + blueprinter (0.30.0) brakeman (6.1.2) racc bugsnag (6.26.4) @@ -143,13 +143,11 @@ GEM coderay (1.1.3) concurrent-ruby (1.2.3) connection_pool (2.4.1) - crack (1.0.0) - bigdecimal + crack (0.4.5) rexml crass (1.0.6) cssbundling-rails (1.4.0) railties (>= 6.0.0) - csv (3.3.0) database_cleaner-active_record (2.1.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) @@ -160,7 +158,7 @@ GEM delayed_job_active_record (4.1.8) activerecord (>= 3.0, < 8.0) delayed_job (>= 3.0, < 5) - devise (4.9.4) + devise (4.9.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -169,16 +167,17 @@ GEM devise_invitable (2.0.9) actionmailer (>= 5.0) devise (>= 4.6) - diff-lcs (1.5.1) + diff-lcs (1.5.0) docile (1.4.0) docx (0.8.0) nokogiri (~> 1.13, >= 1.13.0) rubyzip (~> 2.0) - domain_name (0.6.20240107) - dotenv (3.1.0) - dotenv-rails (3.1.0) - dotenv (= 3.1.0) - railties (>= 6.1) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.8.1) + dotenv-rails (2.8.1) + dotenv (= 2.8.1) + railties (>= 3.2) draper (4.0.2) actionpack (>= 5.0) activemodel (>= 5.0) @@ -199,7 +198,7 @@ GEM rubocop smart_properties erubi (1.12.0) - factory_bot (6.4.6) + factory_bot (6.4.5) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) @@ -231,9 +230,9 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - ffi (1.16.3) - ffi-compiler (1.3.2) - ffi (>= 1.15.5) + ffi (1.15.5) + ffi-compiler (1.0.1) + ffi (>= 1.0.0) rake filterrific (5.2.5) friendly_id (5.5.1) @@ -242,19 +241,17 @@ GEM activesupport (>= 6.1) groupdate (6.4.0) activesupport (>= 6.1) - hashdiff (1.1.0) + hashdiff (1.0.1) htmlentities (4.3.4) - http (5.2.0) + http (5.1.1) addressable (~> 2.8) - base64 (~> 0.1) http-cookie (~> 1.0) http-form_data (~> 2.2) - llhttp-ffi (~> 0.5.0) + llhttp-ffi (~> 0.4.0) http-cookie (1.0.5) domain_name (~> 0.5) http-form_data (2.3.0) - httparty (0.22.0) - csv + httparty (0.21.0) mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) i18n (1.14.4) @@ -266,23 +263,22 @@ GEM irb (1.12.0) rdoc reline (>= 0.4.2) - jbuilder (2.12.0) + jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) jsbundling-rails (1.3.0) railties (>= 6.0.0) - json (2.7.2) - json-schema (4.3.0) + json (2.6.3) + json-schema (4.1.1) addressable (>= 2.8) - jwt (2.8.1) - base64 + jwt (2.7.1) language_server-protocol (3.17.0.3) - launchy (2.5.2) - addressable (~> 2.8) - letter_opener (1.10.0) - launchy (>= 2.2, < 4) + launchy (2.5.0) + addressable (~> 2.7) + letter_opener (1.9.0) + launchy (>= 2.2, < 3) lint_roller (1.1.0) - llhttp-ffi (0.5.0) + llhttp-ffi (0.4.0) ffi-compiler (~> 1.0) rake (~> 13.0) lograge (0.14.0) @@ -300,16 +296,17 @@ GEM net-smtp marcel (1.0.4) matrix (0.4.2) - method_source (1.1.0) - mini_magick (4.12.0) + method_source (1.0.0) + mini_magick (4.11.0) mini_mime (1.1.5) + mini_portile2 (2.8.6) minitest (5.22.3) multi_xml (0.6.0) - multipart-post (2.4.0) + multipart-post (2.3.0) mutex_m (0.2.0) - net-http-persistent (4.0.2) + net-http-persistent (4.0.1) connection_pool (~> 2.2) - net-imap (0.4.10) + net-imap (0.4.9) date net-protocol net-pop (0.1.2) @@ -319,14 +316,11 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.1) - nokogiri (1.16.4-aarch64-linux) - racc (~> 1.4) - nokogiri (1.16.4-arm-linux) + nokogiri (1.16.4) + mini_portile2 (~> 2.8.2) racc (~> 1.4) nokogiri (1.16.4-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.4-x86-linux) - racc (~> 1.4) nokogiri (1.16.4-x86_64-darwin) racc (~> 1.4) nokogiri (1.16.4-x86_64-linux) @@ -337,17 +331,17 @@ GEM oj (3.16.3) bigdecimal (>= 3.0) orm_adapter (0.5.0) - parallel (1.24.0) + parallel (1.23.0) paranoia (2.6.3) activerecord (>= 5.1, < 7.2) - parser (3.3.1.0) + parser (3.2.2.3) ast (~> 2.4.1) racc pdf-forms (1.5.0) cliver (~> 0.3.2) rexml (~> 3.2, >= 3.2.6) safe_shell (>= 1.0.3, < 2.0) - pg (1.5.6) + pg (1.5.4) pretender (0.5.0) actionpack (>= 6.1) pry (0.14.2) @@ -358,24 +352,24 @@ GEM pry (>= 0.13, < 0.15) psych (5.1.2) stringio - public_suffix (5.0.5) + public_suffix (5.0.4) puma (6.4.2) nio4r (~> 2.0) pundit (2.3.1) activesupport (>= 3.0.0) racc (1.7.3) - rack (3.0.10) + rack (2.2.9) rack-attack (6.7.0) rack (>= 1.0, < 4) - rack-cors (2.0.2) + rack-cors (2.0.1) rack (>= 2.0.0) - rack-session (2.0.0) - rack (>= 3.0.0) + rack-session (1.0.2) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rackup (2.1.0) - rack (>= 3) - webrick (~> 1.8) + rackup (1.0.0) + rack (< 3) + webrick rails (7.1.3.2) actioncable (= 7.1.3.2) actionmailbox (= 7.1.3.2) @@ -410,11 +404,11 @@ GEM thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.2.1) + rake (13.1.0) rdoc (6.6.3.1) psych (>= 4.0.0) - regexp_parser (2.9.0) - reline (0.5.4) + regexp_parser (2.8.1) + reline (0.5.0) io-console (~> 0.5) request_store (1.6.0) rack (>= 1.4) @@ -422,23 +416,23 @@ GEM actionpack (>= 5.2) railties (>= 5.2) rexml (3.2.6) - rspec-core (3.13.0) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-rails (6.1.2) + rspec-support (~> 3.12.0) + rspec-rails (6.1.1) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.13) - rspec-expectations (~> 3.13) - rspec-mocks (~> 3.13) - rspec-support (~> 3.13) - rspec-support (3.13.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) + rspec-support (3.12.1) rswag-api (2.13.0) activesupport (>= 3.1, < 7.2) railties (>= 3.1, < 7.2) @@ -462,21 +456,21 @@ GEM rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) - parser (>= 3.3.1.0) - rubocop-performance (1.20.2) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.19.1) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) ruby-progressbar (1.13.0) - ruby-vips (2.2.1) + ruby-vips (2.1.4) ffi (~> 1.12) ruby2_keywords (0.0.5) rubyzip (2.3.2) - sablon (0.4.0) + sablon (0.3.2) nokogiri (>= 1.8.5) - rubyzip (>= 1.3.0) + rubyzip (>= 1.1.1) safe_shell (1.1.0) - scout_apm (5.3.8) + scout_apm (5.3.5) parser selenium-webdriver (4.16.0) rexml (~> 3.2, >= 3.2.5) @@ -491,12 +485,12 @@ GEM simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) smart_properties (1.17.0) - spring (4.2.1) + spring (4.2.0) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - sprockets (4.2.1) + sprockets (4.1.1) concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) + rack (> 1, < 3) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) @@ -510,9 +504,9 @@ GEM standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.3.1) + standard-performance (1.2.1) lint_roller (~> 1.1) - rubocop-performance (~> 1.20.2) + rubocop-performance (~> 1.19.1) stimulus-rails (1.3.3) railties (>= 6.0.0) stringio (3.1.0) @@ -522,15 +516,18 @@ GEM timeout (0.4.1) traceroute (0.8.1) rails (>= 3.0.0) - twilio-ruby (7.0.2) + twilio-ruby (6.9.1) faraday (>= 0.9, < 3.0) jwt (>= 1.5, < 3.0) nokogiri (>= 1.6, < 2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8.2) + unicode-display_width (2.4.2) uniform_notifier (1.16.0) - view_component (3.12.1) + view_component (3.9.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) @@ -557,11 +554,15 @@ GEM zeitwerk (2.6.13) PLATFORMS - aarch64-linux - arm-linux - arm64-darwin - x86-linux - x86_64-darwin + arm64-darwin-20 + arm64-darwin-21 + arm64-darwin-22 + ruby + x86_64-darwin-18 + x86_64-darwin-19 + x86_64-darwin-20 + x86_64-darwin-21 + x86_64-darwin-22 x86_64-linux DEPENDENCIES @@ -647,4 +648,4 @@ RUBY VERSION ruby 3.2.2p53 BUNDLED WITH - 2.5.9 + 2.4.22 diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index d455a3c44f..3513e8a534 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -121,20 +121,20 @@ def unknown_organization end describe "#store_referring_location" do - it 'stores referring location in session if referer is present and not sign in page' do - request.env['HTTP_REFERER'] = 'http://example.com' + it "stores referring location in session if referer is present and not sign in page" do + request.env["HTTP_REFERER"] = "http://example.com" controller.store_referring_location - expect(session[:return_to]).to eq('http://example.com') + expect(session[:return_to]).to eq("http://example.com") end - it 'does not store referring location if referer is sign in page' do - request.env['HTTP_REFERER'] = 'http://example.com/users/sign_in' + it "does not store referring location if referer is sign in page" do + request.env["HTTP_REFERER"] = "http://example.com/users/sign_in" controller.store_referring_location expect(session[:return_to]).to be_nil end - it 'does not store referring location if referer is not present' do - request.env['HTTP_REFERER'] = nil + it "does not store referring location if referer is not present" do + request.env["HTTP_REFERER"] = nil controller.store_referring_location expect(session[:return_to]).to be_nil end diff --git a/spec/presenters/case_contact_presenter_spec.rb b/spec/presenters/case_contact_presenter_spec.rb index 068a54e20b..59dc621c41 100644 --- a/spec/presenters/case_contact_presenter_spec.rb +++ b/spec/presenters/case_contact_presenter_spec.rb @@ -11,34 +11,34 @@ allow_any_instance_of(described_class).to receive(:current_organization).and_return(organization) end - describe '#display_case_number' do - context 'with transition aged youth' do + describe "#display_case_number" do + context "with transition aged youth" do let(:casa_case) { create(:casa_case, birth_month_year_youth: 15.years.ago, casa_org: organization) } - it 'displays the case number with correct icon' do + it "displays the case number with correct icon" do casa_case_id = casa_case.id case_number = casa_case.case_number expect(presenter.display_case_number(casa_case_id)).to eql("🦋 #{case_number}") end - it 'does not error when case number is nil' do - expect(presenter.display_case_number(nil)).to eql('') + it "does not error when case number is nil" do + expect(presenter.display_case_number(nil)).to eql("") end end - context 'with non-transition aged youth' do + context "with non-transition aged youth" do let(:casa_case) { create(:casa_case, birth_month_year_youth: 12.years.ago, casa_org: organization) } - it 'displays the case number with correct icon' do + it "displays the case number with correct icon" do casa_case_id = casa_case.id case_number = casa_case.case_number expect(presenter.display_case_number(casa_case_id)).to eql("🐛 #{case_number}") end - it 'does not error when case number is nil' do - expect(presenter.display_case_number(nil)).to eql('') + it "does not error when case number is nil" do + expect(presenter.display_case_number(nil)).to eql("") end end end From f706920bb939c359f6de4694d59ade9e8979f30f Mon Sep 17 00:00:00 2001 From: guswhitten Date: Tue, 30 Apr 2024 05:25:11 -0400 Subject: [PATCH 5/5] dont lock notified gem --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 245ba201ed..bf7c662e5e 100644 --- a/Gemfile +++ b/Gemfile @@ -28,7 +28,7 @@ gem "lograge" # log less so heroku papertrail quits rate limiting our logs gem "net-smtp", require: false # needed for ruby upgrade to 3.1.0 for some dang reason gem "net-pop" # needed for ruby upgrade to 3.1.0 https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/ gem "net-imap" # needed for ruby upgrade to 3.1.0 https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/ -gem "noticed", "~> 1.6.0" # Notifications +gem "noticed" # Notifications gem "view_component" # View components for reusability gem "paranoia" # For soft-deleting database objects gem "pdf-forms" # filling in fund request PDFs with user input diff --git a/Gemfile.lock b/Gemfile.lock index d12e9ceef7..90fb9a2c25 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -604,7 +604,7 @@ DEPENDENCIES net-imap net-pop net-smtp - noticed (~> 1.6.0) + noticed oj paranoia pdf-forms