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

remove all spec views on destroy controller #2475

Merged
merged 2 commits into from Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/generators/rspec/controller/controller_generator.rb
Expand Up @@ -27,7 +27,7 @@ def generate_controller_spec
end

def generate_view_specs
return if actions.empty?
return if actions.empty? && behavior == :invoke
return unless options[:view_specs] && options[:template_engine]

empty_directory File.join("spec", "views", file_path)
Expand Down
5 changes: 5 additions & 0 deletions spec/generators/rspec/controller/controller_generator_spec.rb
Expand Up @@ -115,6 +115,11 @@
end
end
end

describe 'are removed' do
subject { run_generator %w[posts], behavior: :revoke }
it { is_expected.to match('remove spec/views/posts') }
end
end

describe 'routing spec' do
Expand Down