-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Cop Idea: Disallow Controller Specs #1116
Comments
How do you tell a controller spec from a request spec? |
Canonically: the path. |
IMHO the meta data is fine too. |
I've just recently seen requests specs residing in There's also a major confusion between the two (see rubocop/rspec-style-guide#113) as both of them inherit from So we could come up with a cop that would prevent from writing I'd prefer to apply an effort and help |
An idea to implement such a cop is very tempting, but it would be easier to add a warning on RSpec Rails side. |
@pirj Rubocop makes it easy to introduce a rule in phases -- allow existing offenses and warn new offenses. I can't see how that can be easily done in rspec-rails without reinventing rubocop in a way. Identifying based on path or metadata type should be attack the majority of cases, which in the end will have already helped projects move into the right direction. |
module RSpec::Rails::ControllerExampleGroup no? |
On a codebase with 600 controller specs, I need an easier way to manage a transition. Rubocop offers include/exclude patterns to start enforcing new code only. |
What your suggestion is for the cop exactly, @rafaelsales ? I guess since nobody is going to write the cop for you, you can send a pull request and let’s see how it goes. |
Our project is fairly old and is still in the process of converting over controller specs into request specs. It'd be really helpful to have a cop that disallows the introduction of new controller specs.
The text was updated successfully, but these errors were encountered: