aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/lib/rails/generators/rails/helper/helper_generator.rb2
-rw-r--r--railties/lib/rails/generators/test_unit/helper/helper_generator.rb13
-rw-r--r--railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb6
-rw-r--r--railties/test/generators/helper_generator_test.rb54
4 files changed, 0 insertions, 75 deletions
diff --git a/railties/lib/rails/generators/rails/helper/helper_generator.rb b/railties/lib/rails/generators/rails/helper/helper_generator.rb
index 5ff38e4111..419607839a 100644
--- a/railties/lib/rails/generators/rails/helper/helper_generator.rb
+++ b/railties/lib/rails/generators/rails/helper/helper_generator.rb
@@ -6,8 +6,6 @@ module Rails
def create_helper_files
template 'helper.rb', File.join('app/helpers', class_path, "#{file_name}_helper.rb")
end
-
- hook_for :test_framework
end
end
end
diff --git a/railties/lib/rails/generators/test_unit/helper/helper_generator.rb b/railties/lib/rails/generators/test_unit/helper/helper_generator.rb
deleted file mode 100644
index 0db76f9eaf..0000000000
--- a/railties/lib/rails/generators/test_unit/helper/helper_generator.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'rails/generators/test_unit'
-
-module TestUnit # :nodoc:
- module Generators # :nodoc:
- class HelperGenerator < Base # :nodoc:
- check_class_collision suffix: "HelperTest"
-
- def create_helper_files
- template 'helper_test.rb', File.join('test/helpers', class_path, "#{file_name}_helper_test.rb")
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb b/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb
deleted file mode 100644
index 7d37bda0f9..0000000000
--- a/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require 'test_helper'
-
-<% module_namespacing do -%>
-class <%= class_name %>HelperTest < ActionView::TestCase
-end
-<% end -%>
diff --git a/railties/test/generators/helper_generator_test.rb b/railties/test/generators/helper_generator_test.rb
deleted file mode 100644
index 81d4fcb129..0000000000
--- a/railties/test/generators/helper_generator_test.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'generators/generators_test_helper'
-require 'rails/generators/rails/helper/helper_generator'
-
-ObjectHelper = Class.new
-AnotherObjectHelperTest = Class.new
-
-class HelperGeneratorTest < Rails::Generators::TestCase
- include GeneratorsTestHelper
- arguments %w(admin)
-
- def test_helper_skeleton_is_created
- run_generator
- assert_file "app/helpers/admin_helper.rb", /module AdminHelper/
- end
-
- def test_invokes_default_test_framework
- run_generator
- assert_file "test/helpers/admin_helper_test.rb", /class AdminHelperTest < ActionView::TestCase/
- end
-
- def test_logs_if_the_test_framework_cannot_be_found
- content = run_generator ["admin", "--test-framework=rspec"]
- assert_match(/rspec \[not found\]/, content)
- end
-
- def test_check_class_collision
- content = capture(:stderr){ run_generator ["object"] }
- assert_match(/The name 'ObjectHelper' is either already used in your application or reserved/, content)
- end
-
- def test_check_class_collision_on_tests
- content = capture(:stderr){ run_generator ["another_object"] }
- assert_match(/The name 'AnotherObjectHelperTest' is either already used in your application or reserved/, content)
- end
-
- def test_namespaced_and_not_namespaced_helpers
- run_generator ["products"]
-
- # We have to require the generated helper to show the problem because
- # the test helpers just check for generated files and contents but
- # do not actually load them. But they have to be loaded (as in a real environment)
- # to make the second generator run fail
- require "#{destination_root}/app/helpers/products_helper"
-
- assert_nothing_raised do
- begin
- run_generator ["admin::products"]
- ensure
- # cleanup
- Object.send(:remove_const, :ProductsHelper)
- end
- end
- end
-end