From 1699caf3491b94ca96c76a659253e5a427da6022 Mon Sep 17 00:00:00 2001
From: carolyncole <1599081+carolyncole@users.noreply.github.com>
Date: Wed, 1 May 2024 09:10:24 -0400
Subject: [PATCH] Updating to use new rubocop rules (#670)

Co-authored-by: Bess Sadler <bess.sadler@princeton.edu>
---
 .rubocop.yml                                  | 81 +++++++++++++++++++
 Gemfile.lock                                  | 22 ++---
 .../http/namespace_destroy_request_spec.rb    |  4 +-
 3 files changed, 94 insertions(+), 13 deletions(-)

diff --git a/.rubocop.yml b/.rubocop.yml
index 4f4812ad..2ab5fa31 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -72,3 +72,84 @@ RSpec/ExampleLength:
 
 Style/NumericPredicate:
   Enabled: false
+
+Rails/ActionControllerTestCase: # new in 2.14
+  Enabled: true
+Rails/ActiveRecordCallbacksOrder: # new in 2.7
+  Enabled: true
+Rails/AddColumnIndex: # new in 2.11
+  Enabled: true
+Rails/AfterCommitOverride: # new in 2.8
+  Enabled: true
+Rails/AttributeDefaultBlockValue: # new in 2.9
+  Enabled: true
+Rails/CompactBlank: # new in 2.13
+  Enabled: true
+Rails/DeprecatedActiveModelErrorsMethods: # new in 2.14
+  Enabled: true
+Rails/DotSeparatedKeys: # new in 2.15
+  Enabled: true
+Rails/DuplicateAssociation: # new in 2.14
+  Enabled: true
+Rails/DuplicateScope: # new in 2.14
+  Enabled: true
+Rails/DurationArithmetic: # new in 2.13
+  Enabled: true
+Rails/EagerEvaluationLogMessage: # new in 2.11
+  Enabled: true
+Rails/ExpandedDateRange: # new in 2.11
+  Enabled: true
+Rails/FindById: # new in 2.7
+  Enabled: true
+Rails/I18nLazyLookup: # new in 2.14
+  Enabled: true
+Rails/I18nLocaleAssignment: # new in 2.11
+  Enabled: true
+Rails/I18nLocaleTexts: # new in 2.14
+  Enabled: true
+Rails/Inquiry: # new in 2.7
+  Enabled: true
+Rails/MailerName: # new in 2.7
+  Enabled: true
+Rails/MatchRoute: # new in 2.7
+  Enabled: true
+Rails/MigrationClassName: # new in 2.14
+  Enabled: true
+Rails/NegateInclude: # new in 2.7
+  Enabled: true
+Rails/Pluck: # new in 2.7
+  Enabled: true
+Rails/PluckInWhere: # new in 2.7
+  Enabled: true
+Rails/RedundantPresenceValidationOnBelongsTo: # new in 2.13
+  Enabled: true
+Rails/RedundantTravelBack: # new in 2.12
+  Enabled: true
+Rails/RenderInline: # new in 2.7
+  Enabled: true
+Rails/RenderPlainText: # new in 2.7
+  Enabled: true
+Rails/RootJoinChain: # new in 2.13
+  Enabled: true
+Rails/RootPublicPath: # new in 2.15
+  Enabled: true
+Rails/ShortI18n: # new in 2.7
+  Enabled: true
+Rails/SquishedSQLHeredocs: # new in 2.8
+  Enabled: true
+Rails/StripHeredoc: # new in 2.15
+  Enabled: true
+Rails/TimeZoneAssignment: # new in 2.10
+  Enabled: true
+Rails/ToFormattedS: # new in 2.15
+  Enabled: true
+Rails/TransactionExitStatement: # new in 2.14
+  Enabled: true
+Rails/UnusedIgnoredColumns: # new in 2.11
+  Enabled: true
+Rails/WhereEquals: # new in 2.9
+  Enabled: true
+Rails/WhereExists: # new in 2.7
+  Enabled: true
+Rails/WhereNot: # new in 2.8
+  Enabled: true
diff --git a/Gemfile.lock b/Gemfile.lock
index 9c986b67..e7d104be 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -139,7 +139,7 @@ GEM
     coderay (1.1.3)
     coercible (1.0.0)
       descendants_tracker (~> 0.0.1)
-    concurrent-ruby (1.2.2)
+    concurrent-ruby (1.2.3)
     connection_pool (2.4.1)
     coveralls_reborn (0.28.0)
       simplecov (~> 0.22.0)
@@ -210,7 +210,7 @@ GEM
     health-monitor-rails (11.1.0)
       railties (>= 6.1)
     honeybadger (5.4.1)
-    i18n (1.14.1)
+    i18n (1.14.4)
       concurrent-ruby (~> 1.0)
     ice_nine (0.11.2)
     importmap-rails (1.2.1)
@@ -254,7 +254,7 @@ GEM
     matrix (0.4.2)
     method_source (1.0.0)
     mini_mime (1.1.5)
-    minitest (5.20.0)
+    minitest (5.22.3)
     msgpack (1.7.2)
     mustermann (3.0.0)
       ruby2_keywords (~> 0.0.1)
@@ -287,8 +287,8 @@ GEM
       nokogiri (~> 1.5)
       omniauth (~> 1.2)
     orm_adapter (0.5.0)
-    parallel (1.23.0)
-    parser (3.2.2.3)
+    parallel (1.24.0)
+    parser (3.3.1.0)
       ast (~> 2.4.1)
       racc
     pg (1.5.3)
@@ -305,7 +305,7 @@ GEM
     puma (5.6.7)
       nio4r (~> 2.0)
     racc (1.7.3)
-    rack (2.2.8)
+    rack (2.2.9)
     rack-protection (3.1.0)
       rack (~> 2.2, >= 2.2.4)
     rack-proxy (0.7.7)
@@ -349,7 +349,7 @@ GEM
     redis (4.8.1)
     redis-client (0.19.1)
       connection_pool
-    regexp_parser (2.8.1)
+    regexp_parser (2.9.0)
     reline (0.3.8)
       io-console (~> 0.5)
     responders (3.1.0)
@@ -386,9 +386,9 @@ GEM
       rubocop-ast (>= 1.17.0, < 2.0)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 1.4.0, < 3.0)
-    rubocop-ast (1.29.0)
-      parser (>= 3.2.1.0)
-    rubocop-performance (1.19.0)
+    rubocop-ast (1.31.3)
+      parser (>= 3.3.1.0)
+    rubocop-performance (1.19.1)
       rubocop (>= 1.7.0, < 2.0)
       rubocop-ast (>= 0.4.0)
     rubocop-rails (2.15.2)
@@ -468,7 +468,7 @@ GEM
       railties (>= 6.0.0)
     tzinfo (2.0.6)
       concurrent-ruby (~> 1.0)
-    unicode-display_width (2.4.2)
+    unicode-display_width (2.5.0)
     virtus (2.0.0)
       axiom-types (~> 0.1)
       coercible (~> 1.0)
diff --git a/spec/models/mediaflux/http/namespace_destroy_request_spec.rb b/spec/models/mediaflux/http/namespace_destroy_request_spec.rb
index bdae0c4c..1d8d1cff 100644
--- a/spec/models/mediaflux/http/namespace_destroy_request_spec.rb
+++ b/spec/models/mediaflux/http/namespace_destroy_request_spec.rb
@@ -11,13 +11,13 @@
     mediaflux_id = ProjectMediaflux.create!(project: valid_project, session_id: session_id)
     expect(mediaflux_id).not_to be_nil
     namespace_list = Mediaflux::Http::NamespaceListRequest.new(session_token: session_id, parent_namespace: "/td-test-001/tigerdataNS").namespaces
-    namespace_names = namespace_list.map { |a| a[:name] }
+    namespace_names = namespace_list.pluck(:name)
     expect(namespace_names).to include(namespace)
 
     # Destroy the namespace of the project and everything in it
     described_class.new(session_token: session_id, namespace: "/td-test-001/tigerdataNS/#{namespace}").destroy
     namespace_list = Mediaflux::Http::NamespaceListRequest.new(session_token: session_id, parent_namespace: "/td-test-001/tigerdataNS").namespaces
-    namespace_names = namespace_list.map { |a| a[:name] }
+    namespace_names = namespace_list.pluck(:name)
     expect(namespace_names).not_to include(namespace)
     response = described_class.new(session_token: session_id, namespace: "/td-test-001/tigerdataNS/#{namespace}").destroy
     expect(response[:message]).to include("The namespace '/td-test-001/tigerdataNS/#{namespace}' does not exist or is not accessible")