Skip to content

Commit

Permalink
Merge pull request #2475 from Naokimi/main
Browse files Browse the repository at this point in the history
remove all spec views on destroy controller
  • Loading branch information
JonRowe committed Mar 9, 2021
1 parent 18ab7d3 commit e9c8d4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit e9c8d4c

Please sign in to comment.