From 152a72a4d1fd7ae9361f9625160c1546c1d69102 Mon Sep 17 00:00:00 2001 From: Colby Swandale <996377+colby-swandale@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:23:29 +1100 Subject: [PATCH] Move from SystemTest to ApplicationSystemTestCase --- test/integration/locale_test.rb | 2 +- .../email_confirmation_test.rb | 4 ++-- .../{integration => system}/ownership_request_test.rb | 4 ++-- test/{integration => system}/page_params_test.rb | 4 ++-- test/{integration => system}/pages_test.rb | 4 ++-- test/{integration => system}/password_reset_test.rb | 4 ++-- test/{integration => system}/profile_test.rb | 4 ++-- test/{integration => system}/search_test.rb | 4 ++-- test/{integration => system}/sign_in_test.rb | 4 ++-- test/{integration => system}/sign_up_test.rb | 4 ++-- test/{integration => system}/yank_test.rb | 4 ++-- test/test_helper.rb | 11 ----------- 12 files changed, 21 insertions(+), 32 deletions(-) rename test/{integration => system}/email_confirmation_test.rb (97%) rename test/{integration => system}/ownership_request_test.rb (96%) rename test/{integration => system}/page_params_test.rb (95%) rename test/{integration => system}/pages_test.rb (82%) rename test/{integration => system}/password_reset_test.rb (98%) rename test/{integration => system}/profile_test.rb (98%) rename test/{integration => system}/search_test.rb (97%) rename test/{integration => system}/sign_in_test.rb (99%) rename test/{integration => system}/sign_up_test.rb (97%) rename test/{integration => system}/yank_test.rb (97%) diff --git a/test/integration/locale_test.rb b/test/integration/locale_test.rb index 217ebf30c4d..17d5268abdb 100644 --- a/test/integration/locale_test.rb +++ b/test/integration/locale_test.rb @@ -1,6 +1,6 @@ require "test_helper" -class LocaleTest < SystemTest +class LocaleTest < ActionDispatch::IntegrationTest test "html lang attribute is set from locale" do I18n.available_locales.each do |locale| visit root_path(locale: locale) diff --git a/test/integration/email_confirmation_test.rb b/test/system/email_confirmation_test.rb similarity index 97% rename from test/integration/email_confirmation_test.rb rename to test/system/email_confirmation_test.rb index d55eaa3c727..24deca51ec8 100644 --- a/test/integration/email_confirmation_test.rb +++ b/test/system/email_confirmation_test.rb @@ -1,7 +1,7 @@ -require "test_helper" +require "application_system_test_case" require "helpers/email_helpers" -class EmailConfirmationTest < SystemTest +class EmailConfirmationTest < ApplicationSystemTestCase include ActiveJob::TestHelper setup do diff --git a/test/integration/ownership_request_test.rb b/test/system/ownership_request_test.rb similarity index 96% rename from test/integration/ownership_request_test.rb rename to test/system/ownership_request_test.rb index dba4aca0eb7..f25c41a7c9e 100644 --- a/test/integration/ownership_request_test.rb +++ b/test/system/ownership_request_test.rb @@ -1,7 +1,7 @@ -require "test_helper" +require "application_system_test_case" require "helpers/adoption_helpers" -class OwnershipRequestsTest < SystemTest +class OwnershipRequestsTest < ApplicationSystemTestCase include ActionMailer::TestHelper include AdoptionHelpers diff --git a/test/integration/page_params_test.rb b/test/system/page_params_test.rb similarity index 95% rename from test/integration/page_params_test.rb rename to test/system/page_params_test.rb index 47c048b9e6f..d52e36b4eca 100644 --- a/test/integration/page_params_test.rb +++ b/test/system/page_params_test.rb @@ -1,6 +1,6 @@ -require "test_helper" +require "application_system_test_case" -class PageParamsTest < SystemTest +class PageParamsTest < ApplicationSystemTestCase include SearchKickHelper test "stats with page param more than 10" do diff --git a/test/integration/pages_test.rb b/test/system/pages_test.rb similarity index 82% rename from test/integration/pages_test.rb rename to test/system/pages_test.rb index 25cce82ef58..e81312dcb49 100644 --- a/test/integration/pages_test.rb +++ b/test/system/pages_test.rb @@ -1,6 +1,6 @@ -require "test_helper" +require "application_system_test_case" -class PagesTest < SystemTest +class PagesTest < ApplicationSystemTestCase test "renders existing page" do visit "/" click_link "About" diff --git a/test/integration/password_reset_test.rb b/test/system/password_reset_test.rb similarity index 98% rename from test/integration/password_reset_test.rb rename to test/system/password_reset_test.rb index 327ff07a8a0..4c835799d58 100644 --- a/test/integration/password_reset_test.rb +++ b/test/system/password_reset_test.rb @@ -1,6 +1,6 @@ -require "test_helper" +require "application_system_test_case" -class PasswordResetTest < SystemTest +class PasswordResetTest < ApplicationSystemTestCase include ActiveJob::TestHelper def password_reset_link diff --git a/test/integration/profile_test.rb b/test/system/profile_test.rb similarity index 98% rename from test/integration/profile_test.rb rename to test/system/profile_test.rb index 34540ceee86..43596e18d62 100644 --- a/test/integration/profile_test.rb +++ b/test/system/profile_test.rb @@ -1,6 +1,6 @@ -require "test_helper" +require "application_system_test_case" -class ProfileTest < SystemTest +class ProfileTest < ApplicationSystemTestCase include ActiveJob::TestHelper setup do diff --git a/test/integration/search_test.rb b/test/system/search_test.rb similarity index 97% rename from test/integration/search_test.rb rename to test/system/search_test.rb index bc0c39fed95..1a9e766b07e 100644 --- a/test/integration/search_test.rb +++ b/test/system/search_test.rb @@ -1,6 +1,6 @@ -require "test_helper" +require "application_system_test_case" -class SearchTest < SystemTest +class SearchTest < ApplicationSystemTestCase include SearchKickHelper test "searching for a gem" do diff --git a/test/integration/sign_in_test.rb b/test/system/sign_in_test.rb similarity index 99% rename from test/integration/sign_in_test.rb rename to test/system/sign_in_test.rb index da222320e5d..8b24432b1f9 100644 --- a/test/integration/sign_in_test.rb +++ b/test/system/sign_in_test.rb @@ -1,6 +1,6 @@ -require "test_helper" +require "application_system_test_case" -class SignInTest < SystemTest +class SignInTest < ApplicationSystemTestCase setup do @user = create(:user, email: "nick@example.com", password: PasswordHelpers::SECURE_TEST_PASSWORD, handle: nil) @mfa_user = create(:user, email: "john@example.com", password: PasswordHelpers::SECURE_TEST_PASSWORD, diff --git a/test/integration/sign_up_test.rb b/test/system/sign_up_test.rb similarity index 97% rename from test/integration/sign_up_test.rb rename to test/system/sign_up_test.rb index 5b1128b5499..16a4e6ed866 100644 --- a/test/integration/sign_up_test.rb +++ b/test/system/sign_up_test.rb @@ -1,6 +1,6 @@ -require "test_helper" +require "application_system_test_case" -class SignUpTest < SystemTest +class SignUpTest < ApplicationSystemTestCase test "sign up" do visit sign_up_path diff --git a/test/integration/yank_test.rb b/test/system/yank_test.rb similarity index 97% rename from test/integration/yank_test.rb rename to test/system/yank_test.rb index 3d433b0da4d..a447539670c 100644 --- a/test/integration/yank_test.rb +++ b/test/system/yank_test.rb @@ -1,6 +1,6 @@ -require "test_helper" +require "application_system_test_case" -class YankTest < SystemTest +class YankTest < ApplicationSystemTestCase setup do @user = create(:user, password: PasswordHelpers::SECURE_TEST_PASSWORD) @rubygem = create(:rubygem, name: "sandworm") diff --git a/test/test_helper.rb b/test/test_helper.rb index ad6dd1de2e8..0458b8a2615 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -260,17 +260,6 @@ class ActionDispatch::IntegrationTest # Force loading of ActionDispatch::SystemTesting::* helpers _ = ActionDispatch::SystemTestCase -class SystemTest < ActionDispatch::IntegrationTest - include Capybara::DSL - include Capybara::Minitest::Assertions - include ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper - include ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown - - setup do - Capybara.current_driver = :rack_test - end -end - class AdminPolicyTestCase < ActiveSupport::TestCase def setup requires_avo_pro