aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/test_unit
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators/test_unit')
-rw-r--r--railties/lib/rails/generators/test_unit/controller/controller_generator.rb14
-rw-r--r--railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb8
-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.rb4
-rw-r--r--railties/lib/rails/generators/test_unit/integration/integration_generator.rb13
-rw-r--r--railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb10
-rw-r--r--railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb21
-rw-r--r--railties/lib/rails/generators/test_unit/mailer/templates/fixture3
-rw-r--r--railties/lib/rails/generators/test_unit/mailer/templates/unit_test.rb20
-rw-r--r--railties/lib/rails/generators/test_unit/model/model_generator.rb24
-rw-r--r--railties/lib/rails/generators/test_unit/model/templates/fixtures.yml23
-rw-r--r--railties/lib/rails/generators/test_unit/model/templates/unit_test.rb8
-rw-r--r--railties/lib/rails/generators/test_unit/observer/observer_generator.rb13
-rw-r--r--railties/lib/rails/generators/test_unit/observer/templates/unit_test.rb8
-rw-r--r--railties/lib/rails/generators/test_unit/performance/performance_generator.rb13
-rw-r--r--railties/lib/rails/generators/test_unit/performance/templates/performance_test.rb9
-rw-r--r--railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb13
-rw-r--r--railties/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt8
-rw-r--r--railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb3
-rw-r--r--railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb18
-rw-r--r--railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb47
21 files changed, 0 insertions, 293 deletions
diff --git a/railties/lib/rails/generators/test_unit/controller/controller_generator.rb b/railties/lib/rails/generators/test_unit/controller/controller_generator.rb
deleted file mode 100644
index 39816d9990..0000000000
--- a/railties/lib/rails/generators/test_unit/controller/controller_generator.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'rails/generators/test_unit'
-
-module TestUnit
- module Generators
- class ControllerGenerator < Base
- check_class_collision :suffix => "ControllerTest"
-
- def create_test_files
- template 'functional_test.rb',
- File.join('test/functional', class_path, "#{file_name}_controller_test.rb")
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb
deleted file mode 100644
index 62fa5d86fd..0000000000
--- a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class <%= class_name %>ControllerTest < ActionController::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- 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 4ea80bf7be..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
- module Generators
- class HelperGenerator < Base
- check_class_collision :suffix => "HelperTest"
-
- def create_helper_files
- template 'helper_test.rb', File.join('test/unit/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 591e40900e..0000000000
--- a/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'test_helper'
-
-class <%= class_name %>HelperTest < ActionView::TestCase
-end
diff --git a/railties/lib/rails/generators/test_unit/integration/integration_generator.rb b/railties/lib/rails/generators/test_unit/integration/integration_generator.rb
deleted file mode 100644
index 32d0fac029..0000000000
--- a/railties/lib/rails/generators/test_unit/integration/integration_generator.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'rails/generators/test_unit'
-
-module TestUnit
- module Generators
- class IntegrationGenerator < Base
- check_class_collision :suffix => "Test"
-
- def create_test_files
- template 'integration_test.rb', File.join('test/integration', class_path, "#{file_name}_test.rb")
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb b/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb
deleted file mode 100644
index 2c57158b1c..0000000000
--- a/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'test_helper'
-
-class <%= class_name %>Test < ActionController::IntegrationTest
- fixtures :all
-
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb b/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb
deleted file mode 100644
index 7353e5d61a..0000000000
--- a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'rails/generators/test_unit'
-
-module TestUnit
- module Generators
- class MailerGenerator < Base
- argument :actions, :type => :array, :default => [], :banner => "method method"
- check_class_collision :suffix => "Test"
-
- def create_test_files
- template "unit_test.rb", File.join('test/unit', class_path, "#{file_name}_test.rb")
- end
-
- def create_fixtures_files
- actions.each do |action|
- @action, @path = action, File.join(file_path, action)
- template "fixture", File.join("test/fixtures", @path)
- end
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/fixture b/railties/lib/rails/generators/test_unit/mailer/templates/fixture
deleted file mode 100644
index fcce7bd805..0000000000
--- a/railties/lib/rails/generators/test_unit/mailer/templates/fixture
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= class_name %>#<%= @action %>
-
-Find me in app/views/<%= @path %>
diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/unit_test.rb b/railties/lib/rails/generators/test_unit/mailer/templates/unit_test.rb
deleted file mode 100644
index 4de94076e9..0000000000
--- a/railties/lib/rails/generators/test_unit/mailer/templates/unit_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'test_helper'
-
-class <%= class_name %>Test < ActionMailer::TestCase
-<% for action in actions -%>
- test "<%= action %>" do
- @expected.subject = '<%= class_name %>#<%= action %>'
- @expected.body = read_fixture('<%= action %>')
- @expected.date = Time.now
-
- assert_equal @expected.encoded, <%= class_name %>.create_<%= action %>(@expected.date).encoded
- end
-
-<% end -%>
-<% if actions.blank? -%>
- # replace this with your real tests
- test "the truth" do
- assert true
- end
-<% end -%>
-end
diff --git a/railties/lib/rails/generators/test_unit/model/model_generator.rb b/railties/lib/rails/generators/test_unit/model/model_generator.rb
deleted file mode 100644
index 609b815683..0000000000
--- a/railties/lib/rails/generators/test_unit/model/model_generator.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'rails/generators/test_unit'
-
-module TestUnit
- module Generators
- class ModelGenerator < Base
- argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
- class_option :fixture, :type => :boolean
-
- check_class_collision :suffix => "Test"
-
- def create_test_file
- template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
- end
-
- hook_for :fixture_replacement
-
- def create_fixture_file
- if options[:fixture] && options[:fixture_replacement].nil?
- template 'fixtures.yml', File.join('test/fixtures', "#{table_name}.yml")
- end
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml b/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml
deleted file mode 100644
index a30132bc99..0000000000
--- a/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-
-<% unless attributes.empty? -%>
-one:
-<% for attribute in attributes -%>
- <%= attribute.name %>: <%= attribute.default %>
-<% end -%>
-
-two:
-<% for attribute in attributes -%>
- <%= attribute.name %>: <%= attribute.default %>
-<% end -%>
-<% else -%>
-# This model initially had no columns defined. If you add columns to the
-# model remove the '{}' from the fixture names and add the columns immediately
-# below each fixture, per the syntax in the comments below
-#
-one: {}
-# column: value
-#
-two: {}
-# column: value
-<% end -%> \ No newline at end of file
diff --git a/railties/lib/rails/generators/test_unit/model/templates/unit_test.rb b/railties/lib/rails/generators/test_unit/model/templates/unit_test.rb
deleted file mode 100644
index 3e0bc29d3a..0000000000
--- a/railties/lib/rails/generators/test_unit/model/templates/unit_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class <%= class_name %>Test < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/observer/observer_generator.rb b/railties/lib/rails/generators/test_unit/observer/observer_generator.rb
deleted file mode 100644
index 6cc1158c21..0000000000
--- a/railties/lib/rails/generators/test_unit/observer/observer_generator.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'rails/generators/test_unit'
-
-module TestUnit
- module Generators
- class ObserverGenerator < Base
- check_class_collision :suffix => "ObserverTest"
-
- def create_test_files
- template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_observer_test.rb")
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/observer/templates/unit_test.rb b/railties/lib/rails/generators/test_unit/observer/templates/unit_test.rb
deleted file mode 100644
index 03f6d5666e..0000000000
--- a/railties/lib/rails/generators/test_unit/observer/templates/unit_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class <%= class_name %>ObserverTest < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/performance/performance_generator.rb b/railties/lib/rails/generators/test_unit/performance/performance_generator.rb
deleted file mode 100644
index 99edda5461..0000000000
--- a/railties/lib/rails/generators/test_unit/performance/performance_generator.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'rails/generators/test_unit'
-
-module TestUnit
- module Generators
- class PerformanceGenerator < Base
- check_class_collision :suffix => "Test"
-
- def create_test_files
- template 'performance_test.rb', File.join('test/performance', class_path, "#{file_name}_test.rb")
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/performance/templates/performance_test.rb b/railties/lib/rails/generators/test_unit/performance/templates/performance_test.rb
deleted file mode 100644
index 362e3dc09f..0000000000
--- a/railties/lib/rails/generators/test_unit/performance/templates/performance_test.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'test_helper'
-require 'rails/performance_test_help'
-
-class <%= class_name %>Test < ActionController::PerformanceTest
- # Replace this with your real tests.
- def test_homepage
- get '/'
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb b/railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb
deleted file mode 100644
index 4d65cd7d89..0000000000
--- a/railties/lib/rails/generators/test_unit/plugin/plugin_generator.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'rails/generators/test_unit'
-
-module TestUnit
- module Generators
- class PluginGenerator < Base
- check_class_collision :suffix => "Test"
-
- def create_test_files
- directory '.', 'test'
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt b/railties/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt
deleted file mode 100644
index 3e0bc29d3a..0000000000
--- a/railties/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class <%= class_name %>Test < ActiveSupport::TestCase
- # Replace this with your real tests.
- test "the truth" do
- assert true
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb b/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb
deleted file mode 100644
index 2ca36a1e44..0000000000
--- a/railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'rubygems'
-require 'test/unit'
-require 'active_support'
diff --git a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
deleted file mode 100644
index c0315c7fe6..0000000000
--- a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'rails/generators/test_unit'
-require 'rails/generators/resource_helpers'
-
-module TestUnit
- module Generators
- class ScaffoldGenerator < Base
- include Rails::Generators::ResourceHelpers
-
- class_option :singleton, :type => :boolean, :desc => "Supply to create a singleton controller"
- check_class_collision :suffix => "ControllerTest"
-
- def create_test_files
- template 'functional_test.rb',
- File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb")
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
deleted file mode 100644
index 9380aa49b6..0000000000
--- a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require 'test_helper'
-
-class <%= controller_class_name %>ControllerTest < ActionController::TestCase
-<% unless options[:singleton] -%>
- test "should get index" do
- get :index
- assert_response :success
- assert_not_nil assigns(:<%= table_name %>)
- end
-<% end -%>
-
- test "should get new" do
- get :new
- assert_response :success
- end
-
- test "should create <%= file_name %>" do
- assert_difference('<%= class_name %>.count') do
- post :create, :<%= file_name %> => <%= table_name %>(:one).attributes
- end
-
- assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
- end
-
- test "should show <%= file_name %>" do
- get :show, :id => <%= table_name %>(:one).to_param
- assert_response :success
- end
-
- test "should get edit" do
- get :edit, :id => <%= table_name %>(:one).to_param
- assert_response :success
- end
-
- test "should update <%= file_name %>" do
- put :update, :id => <%= table_name %>(:one).to_param, :<%= file_name %> => <%= table_name %>(:one).attributes
- assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
- end
-
- test "should destroy <%= file_name %>" do
- assert_difference('<%= class_name %>.count', -1) do
- delete :destroy, :id => <%= table_name %>(:one).to_param
- end
-
- assert_redirected_to <%= table_name %>_path
- end
-end