Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsafe autocorrect with Rails/ActionControllerTestCase #832

Closed
isakemanuel opened this issue Oct 25, 2022 · 0 comments
Closed

Unsafe autocorrect with Rails/ActionControllerTestCase #832

isakemanuel opened this issue Oct 25, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@isakemanuel
Copy link

isakemanuel commented Oct 25, 2022

There seems to be inconsistencies with whether Rails/ActionControllerTestCase is regarded as a safe auto-correct or not.
Screenshot 2022-10-25 at 08 59 08


Expected behavior

Rails/ActionControllerTestCase is described as unsafe (This cop’s autocorrection is unsafe because the API of each test case class is different. Make sure to update each test of your controller test cases after changing the superclass.), so it shouldn't be applied when rubocop --autocorrect is run.

Actual behavior

Cop is applied.

Steps to reproduce the problem

  1. Create a test that inherits from ActionController::TestCase
  2. Run only safe rubocops (bundle exec rubocop --autocorrct)
  3. ActionController::TestCase is now replaced with ActionDispatch::IntegrationTest

RuboCop version

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:
You can see extension cop versions (e.g. rubocop-rails, rubocop-performance, and others) output by rubocop -V,
include them as well. Here's an example:

1.35.1 (using Parser 3.1.2.1, rubocop-ast 1.23.0, running on ruby 2.7.6 x86_64-darwin21)
  - rubocop-minitest 0.22.2
  - rubocop-performance 1.14.3
  - rubocop-rails 2.17.0
@koic koic added the bug Something isn't working label Oct 25, 2022
@koic koic closed this as completed in 487463c Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants