1
0
Fork 0
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:
bogdanvlviv 2018-02-23 23:03:50 +02:00
parent 5ecbeda0e2
commit ab63420233
No known key found for this signature in database
GPG key ID: E4ACD76A6DB6DFDD
2 changed files with 6 additions and 1 deletions

View file

@ -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 -%>

View file

@ -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