From 1a0ca84a064b07ecab798793a3d7ebe89bb6367c Mon Sep 17 00:00:00 2001 From: eileencodes Date: Sun, 19 Feb 2017 11:50:42 -0500 Subject: Move and rename system tests * Move system tests back into Action Pack * Rename `ActionSystemTest` to `ActionDispatch::SystemTestCase` * Remove private base module and only make file for public `SystemTestCase` class, name private module `SystemTesting` * Rename `ActionSystemTestCase` to `ApplicationSystemTestCase` * Update corresponding documentation and guides * Delete old `ActionSystemTest` files --- .../generators/rails/app/templates/test/system_test_helper.rb | 2 +- .../generators/rails/plugin/templates/test/system_test_helper.rb | 2 +- .../rails/generators/test_unit/system/templates/system_test.rb | 8 +++++--- .../generators/test_unit/system/templates/system_test_helper.rb | 2 +- railties/lib/rails/test_help.rb | 4 ++-- railties/railties.gemspec | 1 - railties/test/generators/scaffold_generator_test.rb | 2 +- railties/test/generators/system_test_generator_test.rb | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/app/templates/test/system_test_helper.rb b/railties/lib/rails/generators/rails/app/templates/test/system_test_helper.rb index 77c4738d6f..1d0ae787f7 100644 --- a/railties/lib/rails/generators/rails/app/templates/test/system_test_helper.rb +++ b/railties/lib/rails/generators/rails/app/templates/test/system_test_helper.rb @@ -1,6 +1,6 @@ require "test_helper" -class ActionSystemTestCase < ActionSystemTest::Base +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase teardown do take_failed_screenshot Capybara.reset_sessions! diff --git a/railties/lib/rails/generators/rails/plugin/templates/test/system_test_helper.rb b/railties/lib/rails/generators/rails/plugin/templates/test/system_test_helper.rb index 77c4738d6f..1d0ae787f7 100644 --- a/railties/lib/rails/generators/rails/plugin/templates/test/system_test_helper.rb +++ b/railties/lib/rails/generators/rails/plugin/templates/test/system_test_helper.rb @@ -1,6 +1,6 @@ require "test_helper" -class ActionSystemTestCase < ActionSystemTest::Base +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase teardown do take_failed_screenshot Capybara.reset_sessions! diff --git a/railties/lib/rails/generators/test_unit/system/templates/system_test.rb b/railties/lib/rails/generators/test_unit/system/templates/system_test.rb index bc3abd25d9..2afc7a4aac 100644 --- a/railties/lib/rails/generators/test_unit/system/templates/system_test.rb +++ b/railties/lib/rails/generators/test_unit/system/templates/system_test.rb @@ -1,7 +1,9 @@ require "system_test_helper" -class <%= class_name.pluralize %>Test < ActionSystemTestCase - # test 'the truth' do - # assert true +class <%= class_name.pluralize %>Test < ApplicationSystemTestCase + # test "visiting the index" do + # visit <%= plural_table_name %>_url + # + # assert_selector "h1", text: "<%= class_name %>" # end end diff --git a/railties/lib/rails/generators/test_unit/system/templates/system_test_helper.rb b/railties/lib/rails/generators/test_unit/system/templates/system_test_helper.rb index 77c4738d6f..1d0ae787f7 100644 --- a/railties/lib/rails/generators/test_unit/system/templates/system_test_helper.rb +++ b/railties/lib/rails/generators/test_unit/system/templates/system_test_helper.rb @@ -1,6 +1,6 @@ require "test_helper" -class ActionSystemTestCase < ActionSystemTest::Base +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase teardown do take_failed_screenshot Capybara.reset_sessions! diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb index 98bfddb197..75171f2395 100644 --- a/railties/lib/rails/test_help.rb +++ b/railties/lib/rails/test_help.rb @@ -7,7 +7,7 @@ require "active_support/test_case" require "action_controller" require "action_controller/test_case" require "action_dispatch/testing/integration" -require "action_system_test" +require "action_dispatch/system_test_case" require "rails/generators/test_case" require "active_support/testing/autorun" @@ -46,7 +46,7 @@ class ActionDispatch::IntegrationTest end end -class ActionSystemTest::Base +class ActionDispatch::SystemTestCase def before_setup # :nodoc: @routes = Rails.application.routes super diff --git a/railties/railties.gemspec b/railties/railties.gemspec index fb8e666f40..76de2b4639 100644 --- a/railties/railties.gemspec +++ b/railties/railties.gemspec @@ -25,7 +25,6 @@ Gem::Specification.new do |s| s.add_dependency "activesupport", version s.add_dependency "actionpack", version - s.add_dependency "actionsystemtest", version s.add_dependency "rake", ">= 0.8.7" s.add_dependency "thor", ">= 0.18.1", "< 2.0" diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index 43b8ce99ed..436fbd5d73 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -64,7 +64,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase # System tests assert_file "test/system/product_lines_test.rb" do |test| - assert_match(/class ProductLinesTest < ActionSystemTestCase/, test) + assert_match(/class ProductLinesTest < ApplicationSystemTestCase/, test) end # Views diff --git a/railties/test/generators/system_test_generator_test.rb b/railties/test/generators/system_test_generator_test.rb index b6cf75b586..e8e561ec49 100644 --- a/railties/test/generators/system_test_generator_test.rb +++ b/railties/test/generators/system_test_generator_test.rb @@ -7,6 +7,6 @@ class SystemTestGeneratorTest < Rails::Generators::TestCase def test_system_test_skeleton_is_created run_generator - assert_file "test/system/users_test.rb", /class UsersTest < ActionSystemTestCase/ + assert_file "test/system/users_test.rb", /class UsersTest < ApplicationSystemTestCase/ end end -- cgit v1.2.3