aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator
diff options
context:
space:
mode:
authorrick <technoweenie@gmail.com>2008-06-19 09:59:36 -0700
committerrick <technoweenie@gmail.com>2008-06-19 09:59:36 -0700
commit10c581a6deed66e8b62de6e7a3621a63de90baad (patch)
tree588ceb1118761602caa8ccf248dd08d59f33896c /railties/lib/rails_generator
parent64637da284ed4685591c178202ee103e6bee71cf (diff)
parent81025b5808886289f54d698f73f4199c99223e7e (diff)
downloadrails-10c581a6deed66e8b62de6e7a3621a63de90baad.tar.gz
rails-10c581a6deed66e8b62de6e7a3621a63de90baad.tar.bz2
rails-10c581a6deed66e8b62de6e7a3621a63de90baad.zip
fix merge
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r--railties/lib/rails_generator/generators/applications/app/app_generator.rb3
-rw-r--r--railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb2
-rw-r--r--railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb4
-rw-r--r--railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb4
-rw-r--r--railties/lib/rails_generator/generators/components/model/templates/unit_test.rb2
-rw-r--r--railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb2
-rw-r--r--railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb4
-rw-r--r--railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb2
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb14
9 files changed, 20 insertions, 17 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
index 2f2dd82682..80e8eabfd3 100644
--- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb
+++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -51,6 +51,8 @@ class AppGenerator < Rails::Generator::Base
m.template "helpers/application.rb", "app/controllers/application.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest }
m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb"
m.template "helpers/test_helper.rb", "test/test_helper.rb"
+ m.template "helpers/performance_test_helper.rb", "test/performance/test_helper.rb"
+ m.template "helpers/performance_test.rb", "test/performance/browsing_test.rb"
# database.yml and routes.rb
m.template "configs/databases/#{options[:db]}.yml", "config/database.yml", :assigns => {
@@ -155,6 +157,7 @@ class AppGenerator < Rails::Generator::Base
test/fixtures
test/functional
test/integration
+ test/performance
test/unit
vendor
vendor/plugins
diff --git a/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb b/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb
index 38e0ae7123..62fa5d86fd 100644
--- a/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb
+++ b/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb
@@ -2,7 +2,7 @@ require 'test_helper'
class <%= class_name %>ControllerTest < ActionController::TestCase
# Replace this with your real tests.
- def test_truth
+ test "the truth" do
assert true
end
end
diff --git a/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb b/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb
index 149b987d81..2c57158b1c 100644
--- a/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb
+++ b/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb
@@ -1,10 +1,10 @@
require 'test_helper'
class <%= class_name %>Test < ActionController::IntegrationTest
- # fixtures :your, :models
+ fixtures :all
# Replace this with your real tests.
- def test_truth
+ test "the truth" do
assert true
end
end
diff --git a/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb b/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb
index 0b4b2ec60a..1b7bcfef08 100644
--- a/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb
+++ b/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb
@@ -3,7 +3,7 @@ require 'test_helper'
class <%= class_name %>Test < ActionMailer::TestCase
tests <%= class_name %>
<% for action in actions -%>
- def test_<%= action %>
+ test "<%= action %>" do
@expected.subject = '<%= class_name %>#<%= action %>'
@expected.body = read_fixture('<%= action %>')
@expected.date = Time.now
@@ -14,7 +14,7 @@ class <%= class_name %>Test < ActionMailer::TestCase
<% end -%>
<% if actions.blank? -%>
# replace this with your real tests
- def test_truth
+ test "the truth" do
assert true
end
<% end -%>
diff --git a/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb b/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb
index 96bd34adab..3e0bc29d3a 100644
--- a/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb
+++ b/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb
@@ -2,7 +2,7 @@ require 'test_helper'
class <%= class_name %>Test < ActiveSupport::TestCase
# Replace this with your real tests.
- def test_truth
+ test "the truth" do
assert true
end
end
diff --git a/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb b/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb
index 1faf8ed9ac..cae38e9a2a 100644
--- a/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb
+++ b/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb
@@ -2,7 +2,7 @@ require 'test_helper'
class <%= class_name %>ObserverTest < Test::Unit::TestCase
# Replace this with your real tests.
- def test_truth
+ test "the truth" do
assert true
end
end
diff --git a/railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb b/railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb
index 9028b84b7d..6ede6ef1d2 100644
--- a/railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb
+++ b/railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb
@@ -2,7 +2,7 @@ require 'test/unit'
class <%= class_name %>Test < Test::Unit::TestCase
# Replace this with your real tests.
- def test_this_plugin
- flunk
+ test "the truth" do
+ assert true
end
end
diff --git a/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb b/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb
index fbb69fcca7..b1bb1dacbf 100644
--- a/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb
+++ b/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb
@@ -2,7 +2,7 @@ require 'test_helper'
class <%= controller_class_name %>ControllerTest < ActionController::TestCase
# Replace this with your real tests.
- def test_truth
+ test "the truth" do
assert true
end
end
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb b/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb
index 3b430a2061..2d9d635944 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb
@@ -1,18 +1,18 @@
require 'test_helper'
class <%= controller_class_name %>ControllerTest < ActionController::TestCase
- def test_should_get_index
+ test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:<%= table_name %>)
end
- def test_should_get_new
+ test "should get new" do
get :new
assert_response :success
end
- def test_should_create_<%= file_name %>
+ test "should create <%= file_name %>" do
assert_difference('<%= class_name %>.count') do
post :create, :<%= file_name %> => { }
end
@@ -20,22 +20,22 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
end
- def test_should_show_<%= file_name %>
+ test "should show <%= file_name %>" do
get :show, :id => <%= table_name %>(:one).id
assert_response :success
end
- def test_should_get_edit
+ test "should get edit" do
get :edit, :id => <%= table_name %>(:one).id
assert_response :success
end
- def test_should_update_<%= file_name %>
+ test "should update <%= file_name %>" do
put :update, :id => <%= table_name %>(:one).id, :<%= file_name %> => { }
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
end
- def test_should_destroy_<%= file_name %>
+ test "should destroy <%= file_name %>" do
assert_difference('<%= class_name %>.count', -1) do
delete :destroy, :id => <%= table_name %>(:one).id
end