aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/app_generator_test.rb6
-rw-r--r--railties/test/generators/controller_generator_test.rb8
-rw-r--r--railties/test/generators/helper_generator_test.rb2
-rw-r--r--railties/test/generators/integration_test_generator_test.rb2
-rw-r--r--railties/test/generators/mailer_generator_test.rb2
-rw-r--r--railties/test/generators/model_generator_test.rb2
-rw-r--r--railties/test/generators/observer_generator_test.rb2
-rw-r--r--railties/test/generators/resource_generator_test.rb10
-rw-r--r--railties/test/generators/scaffold_controller_generator_test.rb8
-rw-r--r--railties/test/generators/scaffold_generator_test.rb12
10 files changed, 27 insertions, 27 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 51676ff4c2..95ca2acf2c 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -37,11 +37,11 @@ class AppGeneratorTest < Rails::Generators::TestCase
public/javascripts
public/stylesheets
script/rails
- test/controllers
test/fixtures
- test/helpers
- test/models
+ test/functional
+ test/integration
test/performance
+ test/unit
vendor
vendor/plugins
tmp/sessions
diff --git a/railties/test/generators/controller_generator_test.rb b/railties/test/generators/controller_generator_test.rb
index 2974f35dd9..be99dc068d 100644
--- a/railties/test/generators/controller_generator_test.rb
+++ b/railties/test/generators/controller_generator_test.rb
@@ -28,23 +28,23 @@ class ControllerGeneratorTest < Rails::Generators::TestCase
def test_invokes_helper
run_generator
assert_file "app/helpers/account_helper.rb"
- assert_file "test/helpers/account_helper_test.rb"
+ assert_file "test/unit/helpers/account_helper_test.rb"
end
def test_does_not_invoke_helper_if_required
run_generator ["account", "--skip-helper"]
assert_no_file "app/helpers/account_helper.rb"
- assert_no_file "test/helpers/account_helper_test.rb"
+ assert_no_file "test/unit/helpers/account_helper_test.rb"
end
def test_invokes_default_test_framework
run_generator
- assert_file "test/controllers/account_controller_test.rb"
+ assert_file "test/functional/account_controller_test.rb"
end
def test_does_not_invoke_test_framework_if_required
run_generator ["account", "--no-test-framework"]
- assert_no_file "test/controllers/account_controller_test.rb"
+ assert_no_file "test/functional/account_controller_test.rb"
end
def test_invokes_default_template_engine
diff --git a/railties/test/generators/helper_generator_test.rb b/railties/test/generators/helper_generator_test.rb
index b82a72bdd4..f0bfebd57f 100644
--- a/railties/test/generators/helper_generator_test.rb
+++ b/railties/test/generators/helper_generator_test.rb
@@ -15,7 +15,7 @@ class HelperGeneratorTest < Rails::Generators::TestCase
def test_invokes_default_test_framework
run_generator
- assert_file "test/helpers/admin_helper_test.rb", /class AdminHelperTest < ActionView::TestCase/
+ assert_file "test/unit/helpers/admin_helper_test.rb", /class AdminHelperTest < ActionView::TestCase/
end
def test_logs_if_the_test_framework_cannot_be_found
diff --git a/railties/test/generators/integration_test_generator_test.rb b/railties/test/generators/integration_test_generator_test.rb
index 170507458f..cf282a0911 100644
--- a/railties/test/generators/integration_test_generator_test.rb
+++ b/railties/test/generators/integration_test_generator_test.rb
@@ -7,6 +7,6 @@ class IntegrationTestGeneratorTest < Rails::Generators::TestCase
def test_integration_test_skeleton_is_created
run_generator
- assert_file "test/controllers/integration_test.rb", /class IntegrationTest < ActionController::IntegrationTest/
+ assert_file "test/integration/integration_test.rb", /class IntegrationTest < ActionController::IntegrationTest/
end
end
diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb
index c91e2199b7..81d6afa221 100644
--- a/railties/test/generators/mailer_generator_test.rb
+++ b/railties/test/generators/mailer_generator_test.rb
@@ -28,7 +28,7 @@ class MailerGeneratorTest < Rails::Generators::TestCase
def test_invokes_default_test_framework
run_generator
- assert_file "test/controllers/notifier_test.rb" do |test|
+ assert_file "test/functional/notifier_test.rb" do |test|
assert_match /class NotifierTest < ActionMailer::TestCase/, test
assert_match /test "foo"/, test
assert_match /test "bar"/, test
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb
index 5cd86bf95c..f5cfd8eeca 100644
--- a/railties/test/generators/model_generator_test.rb
+++ b/railties/test/generators/model_generator_test.rb
@@ -153,7 +153,7 @@ class ModelGeneratorTest < Rails::Generators::TestCase
def test_invokes_default_test_framework
run_generator
- assert_file "test/models/account_test.rb", /class AccountTest < ActiveSupport::TestCase/
+ assert_file "test/unit/account_test.rb", /class AccountTest < ActiveSupport::TestCase/
assert_file "test/fixtures/accounts.yml", /name: MyString/, /age: 1/
end
diff --git a/railties/test/generators/observer_generator_test.rb b/railties/test/generators/observer_generator_test.rb
index cbf987f10c..45fe8dfbd3 100644
--- a/railties/test/generators/observer_generator_test.rb
+++ b/railties/test/generators/observer_generator_test.rb
@@ -17,7 +17,7 @@ class ObserverGeneratorTest < Rails::Generators::TestCase
def test_invokes_default_test_framework
run_generator
- assert_file "test/observers/account_observer_test.rb", /class AccountObserverTest < ActiveSupport::TestCase/
+ assert_file "test/unit/account_observer_test.rb", /class AccountObserverTest < ActiveSupport::TestCase/
end
def test_logs_if_the_test_framework_cannot_be_found
diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb
index 79fd081018..96fd7a0a72 100644
--- a/railties/test/generators/resource_generator_test.rb
+++ b/railties/test/generators/resource_generator_test.rb
@@ -18,7 +18,7 @@ class ResourceGeneratorTest < Rails::Generators::TestCase
%w(
app/models/account.rb
- test/models/account_test.rb
+ test/unit/account_test.rb
test/fixtures/accounts.yml
).each { |path| assert_file path }
@@ -33,10 +33,10 @@ class ResourceGeneratorTest < Rails::Generators::TestCase
def test_resource_controller_with_pluralized_class_name
run_generator
assert_file "app/controllers/accounts_controller.rb", /class AccountsController < ApplicationController/
- assert_file "test/controllers/accounts_controller_test.rb", /class AccountsControllerTest < ActionController::TestCase/
+ assert_file "test/functional/accounts_controller_test.rb", /class AccountsControllerTest < ActionController::TestCase/
assert_file "app/helpers/accounts_helper.rb", /module AccountsHelper/
- assert_file "test/helpers/accounts_helper_test.rb", /class AccountsHelperTest < ActionView::TestCase/
+ assert_file "test/unit/helpers/accounts_helper_test.rb", /class AccountsHelperTest < ActionView::TestCase/
end
def test_resource_controller_with_actions
@@ -70,14 +70,14 @@ class ResourceGeneratorTest < Rails::Generators::TestCase
def test_plural_names_are_singularized
content = run_generator ["accounts".freeze]
assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/
- assert_file "test/models/account_test.rb", /class AccountTest/
+ assert_file "test/unit/account_test.rb", /class AccountTest/
assert_match /Plural version of the model detected, using singularized version. Override with --force-plural./, content
end
def test_plural_names_can_be_forced
content = run_generator ["accounts", "--force-plural"]
assert_file "app/models/accounts.rb", /class Accounts < ActiveRecord::Base/
- assert_file "test/models/accounts_test.rb", /class AccountsTest/
+ assert_file "test/unit/accounts_test.rb", /class AccountsTest/
assert_no_match /Plural version of the model detected/, content
end
diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb
index 3cc3d49ee9..77ed63b1bb 100644
--- a/railties/test/generators/scaffold_controller_generator_test.rb
+++ b/railties/test/generators/scaffold_controller_generator_test.rb
@@ -54,7 +54,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
def test_helper_are_invoked_with_a_pluralized_name
run_generator
assert_file "app/helpers/users_helper.rb", /module UsersHelper/
- assert_file "test/helpers/users_helper_test.rb", /class UsersHelperTest < ActionView::TestCase/
+ assert_file "test/unit/helpers/users_helper_test.rb", /class UsersHelperTest < ActionView::TestCase/
end
def test_views_are_generated
@@ -72,7 +72,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
def test_functional_tests
run_generator
- assert_file "test/controllers/users_controller_test.rb" do |content|
+ assert_file "test/functional/users_controller_test.rb" do |content|
assert_match /class UsersControllerTest < ActionController::TestCase/, content
assert_match /test "should get index"/, content
end
@@ -85,7 +85,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
assert_no_match /def index/, content
end
- assert_file "test/controllers/users_controller_test.rb" do |content|
+ assert_file "test/functional/users_controller_test.rb" do |content|
assert_no_match /test "should get index"/, content
end
@@ -95,7 +95,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
def test_skip_helper_if_required
run_generator ["User", "name:string", "age:integer", "--no-helper"]
assert_no_file "app/helpers/users_helper.rb"
- assert_no_file "test/helpers/users_helper_test.rb"
+ assert_no_file "test/unit/helpers/users_helper_test.rb"
end
def test_skip_layout_if_required
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb
index 2137f6654d..6cf2efca45 100644
--- a/railties/test/generators/scaffold_generator_test.rb
+++ b/railties/test/generators/scaffold_generator_test.rb
@@ -12,7 +12,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
# Model
assert_file "app/models/product_line.rb", /class ProductLine < ActiveRecord::Base/
- assert_file "test/models/product_line_test.rb", /class ProductLineTest < ActiveSupport::TestCase/
+ assert_file "test/unit/product_line_test.rb", /class ProductLineTest < ActiveSupport::TestCase/
assert_file "test/fixtures/product_lines.yml"
assert_migration "db/migrate/create_product_lines.rb"
@@ -59,7 +59,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
end
end
- assert_file "test/controllers/product_lines_controller_test.rb",
+ assert_file "test/functional/product_lines_controller_test.rb",
/class ProductLinesControllerTest < ActionController::TestCase/
# Views
@@ -74,7 +74,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
# Helpers
assert_file "app/helpers/product_lines_helper.rb"
- assert_file "test/helpers/product_lines_helper_test.rb"
+ assert_file "test/unit/helpers/product_lines_helper_test.rb"
# Stylesheets
assert_file "public/stylesheets/scaffold.css"
@@ -86,7 +86,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
# Model
assert_no_file "app/models/product_line.rb"
- assert_no_file "test/models/product_line_test.rb"
+ assert_no_file "test/unit/product_line_test.rb"
assert_no_file "test/fixtures/product_lines.yml"
assert_no_migration "db/migrate/create_product_lines.rb"
@@ -97,7 +97,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
# Controller
assert_no_file "app/controllers/product_lines_controller.rb"
- assert_no_file "test/controllers/product_lines_controller_test.rb"
+ assert_no_file "test/functional/product_lines_controller_test.rb"
# Views
assert_no_file "app/views/product_lines"
@@ -105,7 +105,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
# Helpers
assert_no_file "app/helpers/product_lines_helper.rb"
- assert_no_file "test/helpers/product_lines_helper_test.rb"
+ assert_no_file "test/unit/helpers/product_lines_helper_test.rb"
# Stylesheets (should not be removed)
assert_file "public/stylesheets/scaffold.css"