about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-20 13:21:19 -0500
committerGitHub <noreply@github.com>2023-02-21 03:21:19 +0900
commit35d032500b7e8c56d3fe3a05bcaa3bddb447b67a (patch)
tree5abdee6b398ae6fbba7eda76b227756660cbbf6e
parent9909b4b653d2f1cef662211a4b8e0b02cbb42fc1 (diff)
Autofix Rubocop Security/IoMethods (#23757)
-rw-r--r--.rubocop_todo.yml7
-rw-r--r--spec/controllers/admin/export_domain_allows_controller_spec.rb4
-rw-r--r--spec/controllers/admin/export_domain_blocks_controller_spec.rb2
3 files changed, 3 insertions, 10 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 2a272b095..331e24e7a 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1956,13 +1956,6 @@ Rails/WhereExists:
     - 'spec/services/purge_domain_service_spec.rb'
     - 'spec/services/unallow_domain_service_spec.rb'
 
-# Offense count: 3
-# This cop supports unsafe autocorrection (--autocorrect-all).
-Security/IoMethods:
-  Exclude:
-    - 'spec/controllers/admin/export_domain_allows_controller_spec.rb'
-    - 'spec/controllers/admin/export_domain_blocks_controller_spec.rb'
-
 # Offense count: 5
 # This cop supports unsafe autocorrection (--autocorrect-all).
 Style/CaseLikeIf:
diff --git a/spec/controllers/admin/export_domain_allows_controller_spec.rb b/spec/controllers/admin/export_domain_allows_controller_spec.rb
index 7ee064de7..1f974bc00 100644
--- a/spec/controllers/admin/export_domain_allows_controller_spec.rb
+++ b/spec/controllers/admin/export_domain_allows_controller_spec.rb
@@ -14,7 +14,7 @@ RSpec.describe Admin::ExportDomainAllowsController, type: :controller do
 
       get :export, params: { format: :csv }
       expect(response).to have_http_status(200)
-      expect(response.body).to eq(IO.read(File.join(file_fixture_path, 'domain_allows.csv')))
+      expect(response.body).to eq(File.read(File.join(file_fixture_path, 'domain_allows.csv')))
     end
   end
 
@@ -30,7 +30,7 @@ RSpec.describe Admin::ExportDomainAllowsController, type: :controller do
       # Domains should now be added
       get :export, params: { format: :csv }
       expect(response).to have_http_status(200)
-      expect(response.body).to eq(IO.read(File.join(file_fixture_path, 'domain_allows.csv')))
+      expect(response.body).to eq(File.read(File.join(file_fixture_path, 'domain_allows.csv')))
     end
 
     it 'displays error on no file selected' do
diff --git a/spec/controllers/admin/export_domain_blocks_controller_spec.rb b/spec/controllers/admin/export_domain_blocks_controller_spec.rb
index 2766102c8..a8d7b7383 100644
--- a/spec/controllers/admin/export_domain_blocks_controller_spec.rb
+++ b/spec/controllers/admin/export_domain_blocks_controller_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe Admin::ExportDomainBlocksController, type: :controller do
 
       get :export, params: { format: :csv }
       expect(response).to have_http_status(200)
-      expect(response.body).to eq(IO.read(File.join(file_fixture_path, 'domain_blocks.csv')))
+      expect(response.body).to eq(File.read(File.join(file_fixture_path, 'domain_blocks.csv')))
     end
   end