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

Rails/ActionControllerTestCase doesn't work for non-empty classes #786

Closed
vlad-pisanov opened this issue Sep 21, 2022 · 0 comments · Fixed by #788
Closed

Rails/ActionControllerTestCase doesn't work for non-empty classes #786

vlad-pisanov opened this issue Sep 21, 2022 · 0 comments · Fixed by #788
Labels
bug Something isn't working

Comments

@vlad-pisanov
Copy link
Contributor

Consider

class C1 < ActionController::TestCase
end

class C2 < ActionController::TestCase
  def test_foo
  end
end

Rails/ActionControllerTestCase flags C1 as an offense, but not C2.

Expected

Both C1 and C2 should be flagged since they inherit from the obsolete ActionController::TestCase

RuboCop version

1.34.1 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 2.6.9 x86_64-darwin21)
  - rubocop-minitest 0.21.0
  - rubocop-performance 1.14.3
  - rubocop-rails 2.15.2
@koic koic added the bug Something isn't working label Sep 22, 2022
koic added a commit to koic/rubocop-rails that referenced this issue Sep 22, 2022
…tCase`

Fixes rubocop#786.

This PR fixes a false negative for `Rails/ActionControllerTestCase`
when extending `ActionController::TestCase` and having a method definition.
@koic koic closed this as completed in #788 Sep 23, 2022
koic added a commit that referenced this issue Sep 23, 2022
…on_controller_test_case

[Fix #786] Fix a false negative for `Rails/ActionControllerTestCase`
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

Successfully merging a pull request may close this issue.

2 participants