mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Improve generated file app/assets/javascripts/application.js
of plugin
Add `//= require rails-ujs` Closes #32094
This commit is contained in:
parent
5ecbeda0e2
commit
ab63420233
2 changed files with 6 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
||||
// about supported directives.
|
||||
//
|
||||
//= require rails-ujs
|
||||
<% unless skip_active_storage? -%>
|
||||
//= require activestorage
|
||||
<% end -%>
|
||||
|
|
|
@ -217,7 +217,11 @@ class PluginGeneratorTest < Rails::Generators::TestCase
|
|||
|
||||
def test_javascripts_generation
|
||||
run_generator [destination_root, "--mountable"]
|
||||
assert_file "app/assets/javascripts/bukkits/application.js"
|
||||
assert_file "app/assets/javascripts/bukkits/application.js" do |content|
|
||||
assert_match "//= require rails-ujs", content
|
||||
assert_match "//= require activestorage", content
|
||||
assert_match "//= require_tree .", content
|
||||
end
|
||||
assert_file "app/views/layouts/bukkits/application.html.erb" do |content|
|
||||
assert_match "javascript_include_tag", content
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue