Skip to content
Browse files

Remove whitespaces and add missing test.

  • Loading branch information...
1 parent f912a35 commit c63600576a7ca63d1a7243308ca8cc7f0e3cde75 @josevalim josevalim committed Nov 11, 2010
View
17 railties/test/generators/app_generator_test.rb
@@ -83,11 +83,11 @@ def test_application_name_is_detected_if_it_exists_and_app_folder_renamed
assert_file "myapp_moved/config/environment.rb", /Myapp::Application\.initialize!/
assert_file "myapp_moved/config/initializers/session_store.rb", /_myapp_session/
end
-
+
def test_rails_update_generates_correct_session_key
app_root = File.join(destination_root, 'myapp')
run_generator [app_root]
-
+
Rails.application.config.root = app_root
Rails.application.class.stubs(:name).returns("Myapp")
Rails.application.stubs(:is_a?).returns(Rails::Application)
@@ -137,23 +137,23 @@ def test_prototype_and_test_unit_are_added_by_default
assert_file "public/javascripts/rails.js"
assert_file "test"
end
-
+
def test_javascript_is_skipped_if_required
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/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 "public/javascripts/application.js"
assert_file "public/javascripts/prototype.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\)/
@@ -186,6 +186,13 @@ def test_file_is_added_for_backwards_compatibility
assert_file 'lib/test_file.rb', 'heres test data'
end
+ def test_test_unit_is_removed_from_frameworks_if_skip_test_unit_is_given
+ run_generator [destination_root, "--skip-test-unit"]
+ assert_file "config/application.rb" do |file|
+ assert_match /config.generators.test_framework = false/, file
+ end
+ end
+
protected
def action(*args, &block)
View
1 railties/test/generators/plugin_new_generator_test.rb
@@ -18,7 +18,6 @@
test/dummy
)
-
class PluginNewGeneratorTest < Rails::Generators::TestCase
include GeneratorsTestHelper
destination File.join(Rails.root, "tmp/bukkits")

0 comments on commit c636005

Please sign in to comment.
Something went wrong with that request. Please try again.