rubocop-rspec
rubocop-rspec copied to clipboard
Cop idea: don't use render_views
render_views couples together controller and view tests, which some may find undesirable. Rubocop could help out by adding a cop forbidding use of that feature?
I don’t think we can do that. Investigating your rspec configuration is a runtime check, but RuboCop does static analysis i.e. looks at your code without running it.
Could it just check for that text in the spec files? I mean, I can basically do it with grep. Forgive me if that's wildly unhelpful, I have no idea how Rubocop works internally :)
I guess though if someone else uses that method name, that wouldn't work.
You are right, render_views isn’t a config option, but an rspec-rails method. We can catch this in rubocop-rspec.
Controller specs are deprecated in favour of request specs. Do you think it still makes sense to implement this?