diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-12-15 12:20:20 +0100 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-16 01:49:30 +0530 |
commit | 978314c4e1fc6460da887bd850f0df946fe680b7 (patch) | |
tree | b179a5b5d2f817e267926202852688acac2583f1 /railties/test/generators | |
parent | a462a76bd323ef0087ead0bf0d1792a95655975c (diff) | |
download | rails-978314c4e1fc6460da887bd850f0df946fe680b7.tar.gz rails-978314c4e1fc6460da887bd850f0df946fe680b7.tar.bz2 rails-978314c4e1fc6460da887bd850f0df946fe680b7.zip |
Generate javascripts in engine with --mountable option
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/plugin_new_generator_test.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index 0d24821ff6..e146cb2bb3 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -91,6 +91,35 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase assert_file "test/dummy/config/database.yml", /postgres/ end + def test_skipping_javascripts_without_mountable_option + run_generator + assert_no_file "public/javascripts/prototype.js" + assert_no_file "public/javascripts/rails.js" + assert_no_file "public/javascripts/controls.js" + assert_no_file "public/javascripts/dragdrop.js" + assert_no_file "public/javascripts/dragdrop.js" + assert_no_file "public/javascripts/application.js" + end + + def test_javascripts_generation + run_generator [destination_root, "--mountable"] + assert_file "public/javascripts/rails.js" + assert_file "public/javascripts/prototype.js" + assert_file "public/javascripts/controls.js" + assert_file "public/javascripts/dragdrop.js" + assert_file "public/javascripts/dragdrop.js" + assert_file "public/javascripts/application.js" + end + + def test_skip_javascripts + run_generator [destination_root, "--skip-javascript", "--mountable"] + assert_no_file "public/javascripts/prototype.js" + assert_no_file "public/javascripts/rails.js" + assert_no_file "public/javascripts/controls.js" + assert_no_file "public/javascripts/dragdrop.js" + assert_no_file "public/javascripts/dragdrop.js" + end + def test_ensure_that_javascript_option_is_passed_to_app_generator run_generator [destination_root, "--javascript", "jquery"] assert_file "test/dummy/public/javascripts/jquery.js" |