提交 96093e3c 编写于 作者: J Jey Balachandran

Ensure Action Cable files are removed when `skip_action_cable` is set.

The Action Cable generators creates four files which need to be removed
if `skip_action_cable` is set.

1. `app/assets/javascripts/cable.coffee`
2. `app/channels/application_cable/channel.rb`
3. `app/channels/application_cable/connection.rb`
4. `config/redis/cable.yml`

Fixes #22669.
上级 914a45b5
......@@ -313,6 +313,14 @@ def delete_active_record_initializers_skipping_active_record
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 @@ def test_generator_if_skip_sprockets_is_given
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册