aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-03-24 23:43:37 +0100
committerXavier Noria <fxn@hashref.com>2011-04-13 13:23:16 +0200
commit096fa1b60f537c7c30db35f5576ab351c67a5064 (patch)
tree7a66e8bfe57359f6a6a20ffa0cd10602b3e4637d /railties/test/generators
parent805126b20a39c6f05c46bff780245b0e1c6bc046 (diff)
downloadrails-096fa1b60f537c7c30db35f5576ab351c67a5064.tar.gz
rails-096fa1b60f537c7c30db35f5576ab351c67a5064.tar.bz2
rails-096fa1b60f537c7c30db35f5576ab351c67a5064.zip
jQuery is the new default
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/app_generator_test.rb19
-rw-r--r--railties/test/generators/plugin_new_generator_test.rb21
2 files changed, 14 insertions, 26 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 43f2fbd71c..dfb7adf459 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -146,15 +146,12 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_file "config/application.rb", /#\s+require\s+["']active_record\/railtie["']/
end
- def test_prototype_and_test_unit_are_added_by_default
+ def test_jquery_and_test_unit_are_added_by_default
run_generator
- assert_file "config/application.rb", /#\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(jquery rails\)/
+ assert_file "config/application.rb", /#\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(prototype effects dragdrop controls rails\)/
assert_file "public/javascripts/application.js"
- assert_file "public/javascripts/prototype.js"
+ assert_file "public/javascripts/jquery.js"
assert_file "public/javascripts/rails.js"
- assert_file "public/javascripts/controls.js"
- assert_file "public/javascripts/dragdrop.js"
- assert_file "public/javascripts/effects.js"
assert_file "test"
end
@@ -162,24 +159,24 @@ class AppGeneratorTest < Rails::Generators::TestCase
run_generator [destination_root, "--skip-javascript"]
assert_file "config/application.rb", /^\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(\)/
assert_file "public/javascripts/application.js"
- assert_no_file "public/javascripts/prototype.js"
+ assert_no_file "public/javascripts/jquery.js"
assert_no_file "public/javascripts/rails.js"
end
def test_config_prototype_javascript_library
run_generator [destination_root, "-j", "prototype"]
- assert_file "config/application.rb", /#\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(jquery rails\)/
+ assert_file "config/application.rb", /^\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(prototype effects dragdrop controls rails\)/
assert_file "public/javascripts/application.js"
assert_file "public/javascripts/prototype.js"
- assert_file "public/javascripts/controls.js"
- assert_file "public/javascripts/dragdrop.js"
assert_file "public/javascripts/effects.js"
+ assert_file "public/javascripts/dragdrop.js"
+ assert_file "public/javascripts/controls.js"
assert_file "public/javascripts/rails.js", /prototype/
end
def test_config_jquery_javascript_library
run_generator [destination_root, "-j", "jquery"]
- assert_file "config/application.rb", /^\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(jquery rails\)/
+ assert_file "config/application.rb", /#\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(prototype effects dragdrop controls rails\)/
assert_file "public/javascripts/application.js"
assert_file "public/javascripts/jquery.js"
assert_file "public/javascripts/rails.js", /jQuery/
diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb
index 3c11c8dbaf..402fd25b14 100644
--- a/railties/test/generators/plugin_new_generator_test.rb
+++ b/railties/test/generators/plugin_new_generator_test.rb
@@ -95,41 +95,32 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
def test_skipping_javascripts_without_mountable_option
run_generator
- assert_no_file "public/javascripts/prototype.js"
+ assert_no_file "public/javascripts/jquery.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/jquery.js"
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/jquery.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"
+ run_generator [destination_root, "--javascript", "prototype"]
+ assert_file "test/dummy/public/javascripts/prototype.js"
end
def test_ensure_that_skip_javascript_option_is_passed_to_app_generator
run_generator [destination_root, "--skip_javascript"]
- assert_no_file "test/dummy/public/javascripts/prototype.js"
+ assert_no_file "test/dummy/public/javascripts/jquery.js"
end
def test_template_from_dir_pwd