Skip to content

Commit

Permalink
Merge pull request #32095 from bogdanvlviv/require_rails-ujs-in-gener…
Browse files Browse the repository at this point in the history
…ated-engine

Improve generated file `app/assets/javascripts/application.js` of plugin
  • Loading branch information
rafaelfranca committed Feb 23, 2018
2 parents 1077ae9 + ab63420 commit 222f905
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Expand Up @@ -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 -%>
Expand Down
6 changes: 5 additions & 1 deletion railties/test/generators/plugin_generator_test.rb
Expand Up @@ -217,7 +217,11 @@ def test_skipping_javascripts_without_mountable_option

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
Expand Down

0 comments on commit 222f905

Please sign in to comment.