mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #22685 from jeyb/remove_cable_files_for_skip_action_cable
Ensure Action Cable files are removed when `skip_action_cable` is set.
This commit is contained in:
commit
73dcf00c1f
2 changed files with 11 additions and 0 deletions
|
@ -313,6 +313,14 @@ module Rails
|
|||
end
|
||||
end
|
||||
|
||||
def delete_action_cable_files_skipping_action_cable
|
||||
if options[:skip_action_cable]
|
||||
remove_file 'config/redis/cable.yml'
|
||||
remove_file 'app/assets/javascripts/cable.coffee'
|
||||
remove_dir 'app/channels'
|
||||
end
|
||||
end
|
||||
|
||||
def delete_non_api_initializers_if_api_option
|
||||
if options[:api]
|
||||
remove_file 'config/initializers/session_store.rb'
|
||||
|
|
|
@ -379,6 +379,9 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
|||
def test_generator_if_skip_action_cable_is_given
|
||||
run_generator [destination_root, "--skip-action-cable"]
|
||||
assert_file "config/application.rb", /#\s+require\s+["']action_cable\/engine["']/
|
||||
assert_no_file "config/redis/cable.yml"
|
||||
assert_no_file "app/assets/javascripts/cable.coffee"
|
||||
assert_no_file "app/channels"
|
||||
end
|
||||
|
||||
def test_inclusion_of_javascript_runtime
|
||||
|
|
Loading…
Reference in a new issue