diff --git a/.rspec b/.rspec
index 53607ea52b7..4d520043cf8 100644
--- a/.rspec
+++ b/.rspec
@@ -1 +1,2 @@
--colour
+--require 'rails_helper'
diff --git a/plugins/discourse-local-dates/spec/integration/local_dates_spec.rb b/plugins/discourse-local-dates/spec/integration/local_dates_spec.rb
index d8a10857f80..651a12ea89d 100644
--- a/plugins/discourse-local-dates/spec/integration/local_dates_spec.rb
+++ b/plugins/discourse-local-dates/spec/integration/local_dates_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe "Local Dates" do
before do
freeze_time DateTime.parse('2018-11-10 12:00')
diff --git a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb
index d90d26da356..c365ffaf5e9 100644
--- a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb
+++ b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
def generate_html(text, opts = {})
output = "
0')
diff --git a/spec/lib/archetype_spec.rb b/spec/lib/archetype_spec.rb
index 6414980e7f1..d20f1105f26 100644
--- a/spec/lib/archetype_spec.rb
+++ b/spec/lib/archetype_spec.rb
@@ -1,7 +1,6 @@
# encoding: utf-8
# frozen_string_literal: true
-require 'rails_helper'
require 'archetype'
describe Archetype do
diff --git a/spec/lib/auth/default_current_user_provider_spec.rb b/spec/lib/auth/default_current_user_provider_spec.rb
index d684a0f5409..7fd7d4a3ca9 100644
--- a/spec/lib/auth/default_current_user_provider_spec.rb
+++ b/spec/lib/auth/default_current_user_provider_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Auth::DefaultCurrentUserProvider do
# careful using fab! here is can lead to an erratic test
# we want a distinct user object per test so last_seen_at is
diff --git a/spec/lib/auth/discord_authenticator_spec.rb b/spec/lib/auth/discord_authenticator_spec.rb
index 3a9ad73a1e9..13ea3a44e0d 100644
--- a/spec/lib/auth/discord_authenticator_spec.rb
+++ b/spec/lib/auth/discord_authenticator_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Auth::DiscordAuthenticator do
let(:hash) {
OmniAuth::AuthHash.new(
diff --git a/spec/lib/auth/facebook_authenticator_spec.rb b/spec/lib/auth/facebook_authenticator_spec.rb
index eae3e2bf21b..93a8778f39c 100644
--- a/spec/lib/auth/facebook_authenticator_spec.rb
+++ b/spec/lib/auth/facebook_authenticator_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Auth::FacebookAuthenticator do
let(:hash) {
{
diff --git a/spec/lib/auth/github_authenticator_spec.rb b/spec/lib/auth/github_authenticator_spec.rb
index ee6917bfe3b..33a9a7ac543 100644
--- a/spec/lib/auth/github_authenticator_spec.rb
+++ b/spec/lib/auth/github_authenticator_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
def auth_token_for(user)
{
provider: "github",
diff --git a/spec/lib/auth/google_oauth2_authenticator_spec.rb b/spec/lib/auth/google_oauth2_authenticator_spec.rb
index b82649070d8..76ec7e9d76b 100644
--- a/spec/lib/auth/google_oauth2_authenticator_spec.rb
+++ b/spec/lib/auth/google_oauth2_authenticator_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Auth::GoogleOAuth2Authenticator do
it 'does not look up user unless email is verified' do
# note, emails that come back from google via omniauth are always valid
diff --git a/spec/lib/auth/managed_authenticator_spec.rb b/spec/lib/auth/managed_authenticator_spec.rb
index 1c04b910f21..23c196d6bf6 100644
--- a/spec/lib/auth/managed_authenticator_spec.rb
+++ b/spec/lib/auth/managed_authenticator_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Auth::ManagedAuthenticator do
let(:authenticator) {
Class.new(described_class) do
diff --git a/spec/lib/auth/omniauth_strategies/discourse_google_oauth2_spec.rb b/spec/lib/auth/omniauth_strategies/discourse_google_oauth2_spec.rb
index e5eda8ff6b0..d2ef65ceb4a 100644
--- a/spec/lib/auth/omniauth_strategies/discourse_google_oauth2_spec.rb
+++ b/spec/lib/auth/omniauth_strategies/discourse_google_oauth2_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Auth::OmniAuthStrategies::DiscourseGoogleOauth2 do
let(:response_hash) do
{
diff --git a/spec/lib/auth/result_spec.rb b/spec/lib/auth/result_spec.rb
index 3c39cf7a944..6dd3d47a823 100644
--- a/spec/lib/auth/result_spec.rb
+++ b/spec/lib/auth/result_spec.rb
@@ -1,6 +1,4 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Auth::Result do
fab!(:initial_email) { "initialemail@example.org" }
fab!(:initial_username) { "initialusername" }
diff --git a/spec/lib/auth/twitter_authenticator_spec.rb b/spec/lib/auth/twitter_authenticator_spec.rb
index 0e99fbdc71c..3cf3fe861d4 100644
--- a/spec/lib/auth/twitter_authenticator_spec.rb
+++ b/spec/lib/auth/twitter_authenticator_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Auth::TwitterAuthenticator do
it "takes over account if email is supplied" do
diff --git a/spec/lib/backup_restore/backup_file_handler_multisite_spec.rb b/spec/lib/backup_restore/backup_file_handler_multisite_spec.rb
index 6111be6870e..f5c6ac4717a 100644
--- a/spec/lib/backup_restore/backup_file_handler_multisite_spec.rb
+++ b/spec/lib/backup_restore/backup_file_handler_multisite_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
require_relative "shared_context_for_backup_restore"
describe BackupRestore::BackupFileHandler, type: :multisite do
diff --git a/spec/lib/backup_restore/backup_file_handler_spec.rb b/spec/lib/backup_restore/backup_file_handler_spec.rb
index 3acec9fe605..1e0eaeeb58c 100644
--- a/spec/lib/backup_restore/backup_file_handler_spec.rb
+++ b/spec/lib/backup_restore/backup_file_handler_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require_relative 'shared_context_for_backup_restore'
describe BackupRestore::BackupFileHandler do
diff --git a/spec/lib/backup_restore/backuper_spec.rb b/spec/lib/backup_restore/backuper_spec.rb
index 149b2e423f0..6c9e64829fb 100644
--- a/spec/lib/backup_restore/backuper_spec.rb
+++ b/spec/lib/backup_restore/backuper_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe BackupRestore::Backuper do
it 'returns a non-empty parameterized title when site title contains unicode' do
SiteSetting.title = 'Æ”'
diff --git a/spec/lib/backup_restore/database_restorer_multisite_spec.rb b/spec/lib/backup_restore/database_restorer_multisite_spec.rb
index 5deeb594e88..dea3029418f 100644
--- a/spec/lib/backup_restore/database_restorer_multisite_spec.rb
+++ b/spec/lib/backup_restore/database_restorer_multisite_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
require_relative "shared_context_for_backup_restore"
describe BackupRestore::DatabaseRestorer, type: :multisite do
diff --git a/spec/lib/backup_restore/database_restorer_spec.rb b/spec/lib/backup_restore/database_restorer_spec.rb
index e1b4c8726ff..1655ec68eeb 100644
--- a/spec/lib/backup_restore/database_restorer_spec.rb
+++ b/spec/lib/backup_restore/database_restorer_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require_relative 'shared_context_for_backup_restore'
describe BackupRestore::DatabaseRestorer do
diff --git a/spec/lib/backup_restore/local_backup_store_spec.rb b/spec/lib/backup_restore/local_backup_store_spec.rb
index 3cf1ea42518..3d829ceab4e 100644
--- a/spec/lib/backup_restore/local_backup_store_spec.rb
+++ b/spec/lib/backup_restore/local_backup_store_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'backup_restore/local_backup_store'
require_relative 'shared_examples_for_backup_store'
diff --git a/spec/lib/backup_restore/meta_data_handler_spec.rb b/spec/lib/backup_restore/meta_data_handler_spec.rb
index 7d6ddc8ad43..fb3229a2ab9 100644
--- a/spec/lib/backup_restore/meta_data_handler_spec.rb
+++ b/spec/lib/backup_restore/meta_data_handler_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require_relative 'shared_context_for_backup_restore'
describe BackupRestore::MetaDataHandler do
diff --git a/spec/lib/backup_restore/s3_backup_store_spec.rb b/spec/lib/backup_restore/s3_backup_store_spec.rb
index c4120a3964a..b7e39a9f4d3 100644
--- a/spec/lib/backup_restore/s3_backup_store_spec.rb
+++ b/spec/lib/backup_restore/s3_backup_store_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 's3_helper'
require 'backup_restore/s3_backup_store'
require_relative 'shared_examples_for_backup_store'
diff --git a/spec/lib/backup_restore/system_interface_multisite_spec.rb b/spec/lib/backup_restore/system_interface_multisite_spec.rb
index 93d1c7dc3bb..eeea97336ff 100644
--- a/spec/lib/backup_restore/system_interface_multisite_spec.rb
+++ b/spec/lib/backup_restore/system_interface_multisite_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
require_relative "shared_context_for_backup_restore"
describe BackupRestore::SystemInterface, type: :multisite do
diff --git a/spec/lib/backup_restore/system_interface_spec.rb b/spec/lib/backup_restore/system_interface_spec.rb
index 8ebfd4cabb8..fe0740c3b4c 100644
--- a/spec/lib/backup_restore/system_interface_spec.rb
+++ b/spec/lib/backup_restore/system_interface_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require_relative 'shared_context_for_backup_restore'
describe BackupRestore::SystemInterface do
diff --git a/spec/lib/backup_restore/uploads_restorer_spec.rb b/spec/lib/backup_restore/uploads_restorer_spec.rb
index cd3079e1fa8..92cdf1ef669 100644
--- a/spec/lib/backup_restore/uploads_restorer_spec.rb
+++ b/spec/lib/backup_restore/uploads_restorer_spec.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
# rubocop:disable Discourse/OnlyTopLevelMultisiteSpecs
-require 'rails_helper'
require_relative 'shared_context_for_backup_restore'
describe BackupRestore::UploadsRestorer do
diff --git a/spec/lib/bookmark_manager_spec.rb b/spec/lib/bookmark_manager_spec.rb
index d2d910cb676..a6de9fb2ec8 100644
--- a/spec/lib/bookmark_manager_spec.rb
+++ b/spec/lib/bookmark_manager_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe BookmarkManager do
let(:user) { Fabricate(:user) }
diff --git a/spec/lib/bookmark_query_spec.rb b/spec/lib/bookmark_query_spec.rb
index b1a94462e66..8bfe3cf97c2 100644
--- a/spec/lib/bookmark_query_spec.rb
+++ b/spec/lib/bookmark_query_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe BookmarkQuery do
before do
SearchIndexer.enable
diff --git a/spec/lib/bookmark_reminder_notification_handler_spec.rb b/spec/lib/bookmark_reminder_notification_handler_spec.rb
index 136776805e2..9e7dc0e06ca 100644
--- a/spec/lib/bookmark_reminder_notification_handler_spec.rb
+++ b/spec/lib/bookmark_reminder_notification_handler_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe BookmarkReminderNotificationHandler do
subject { described_class }
diff --git a/spec/lib/browser_detection_spec.rb b/spec/lib/browser_detection_spec.rb
index b6faa54f113..e0e5f695210 100644
--- a/spec/lib/browser_detection_spec.rb
+++ b/spec/lib/browser_detection_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'browser_detection'
describe BrowserDetection do
diff --git a/spec/lib/cache_spec.rb b/spec/lib/cache_spec.rb
index 32567113d00..2a8d77a5ed4 100644
--- a/spec/lib/cache_spec.rb
+++ b/spec/lib/cache_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'cache'
describe Cache do
diff --git a/spec/lib/category_badge_spec.rb b/spec/lib/category_badge_spec.rb
index 76eb8c23d65..46d45c92915 100644
--- a/spec/lib/category_badge_spec.rb
+++ b/spec/lib/category_badge_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'category_badge'
describe CategoryBadge do
diff --git a/spec/lib/common_passwords/common_passwords_spec.rb b/spec/lib/common_passwords/common_passwords_spec.rb
index 4533de82008..cd0f9ab7b19 100644
--- a/spec/lib/common_passwords/common_passwords_spec.rb
+++ b/spec/lib/common_passwords/common_passwords_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe CommonPasswords do
it "the passwords file should exist" do
expect(File.exist?(described_class::PASSWORD_FILE)).to eq(true)
diff --git a/spec/lib/composer_messages_finder_spec.rb b/spec/lib/composer_messages_finder_spec.rb
index 15bb3e892fe..6830d6cc944 100644
--- a/spec/lib/composer_messages_finder_spec.rb
+++ b/spec/lib/composer_messages_finder_spec.rb
@@ -1,7 +1,6 @@
# encoding: utf-8
# frozen_string_literal: true
-require 'rails_helper'
require 'composer_messages_finder'
describe ComposerMessagesFinder do
diff --git a/spec/lib/compression/engine_spec.rb b/spec/lib/compression/engine_spec.rb
index 27a161934ae..a025eaf0431 100644
--- a/spec/lib/compression/engine_spec.rb
+++ b/spec/lib/compression/engine_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Compression::Engine do
let(:available_size) { SiteSetting.decompressed_theme_max_file_size_mb }
diff --git a/spec/lib/concern/cached_counting_spec.rb b/spec/lib/concern/cached_counting_spec.rb
index a71694f3a6b..190fe105b09 100644
--- a/spec/lib/concern/cached_counting_spec.rb
+++ b/spec/lib/concern/cached_counting_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
class TestCachedCounting
def self.clear!
@data = nil
diff --git a/spec/lib/concern/category_hashtag_spec.rb b/spec/lib/concern/category_hashtag_spec.rb
index c89dbb575b0..957c3c92f05 100644
--- a/spec/lib/concern/category_hashtag_spec.rb
+++ b/spec/lib/concern/category_hashtag_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe CategoryHashtag do
describe '#query_from_hashtag_slug' do
fab!(:parent_category) { Fabricate(:category) }
diff --git a/spec/lib/concern/has_custom_fields_spec.rb b/spec/lib/concern/has_custom_fields_spec.rb
index c187bdba376..54154a3030a 100644
--- a/spec/lib/concern/has_custom_fields_spec.rb
+++ b/spec/lib/concern/has_custom_fields_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe HasCustomFields do
context "custom_fields" do
before do
diff --git a/spec/lib/concern/has_search_data_spec.rb b/spec/lib/concern/has_search_data_spec.rb
index e064ec33539..72795c3f6fb 100644
--- a/spec/lib/concern/has_search_data_spec.rb
+++ b/spec/lib/concern/has_search_data_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe HasSearchData do
context "belongs to its model" do
before do
diff --git a/spec/lib/concern/positionable_spec.rb b/spec/lib/concern/positionable_spec.rb
index dc7baa6c3bd..76ca109ffa3 100644
--- a/spec/lib/concern/positionable_spec.rb
+++ b/spec/lib/concern/positionable_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Positionable do
def positions
diff --git a/spec/lib/concern/searchable_spec.rb b/spec/lib/concern/searchable_spec.rb
index a4548621eae..830ea311e41 100644
--- a/spec/lib/concern/searchable_spec.rb
+++ b/spec/lib/concern/searchable_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Searchable do
context "has search data" do
before do
diff --git a/spec/lib/concern/second_factor_manager_spec.rb b/spec/lib/concern/second_factor_manager_spec.rb
index 1dd7bb47286..5d366424edc 100644
--- a/spec/lib/concern/second_factor_manager_spec.rb
+++ b/spec/lib/concern/second_factor_manager_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe SecondFactorManager do
fab!(:user) { Fabricate(:user) }
fab!(:user_second_factor_totp) { Fabricate(:user_second_factor_totp, user: user) }
diff --git a/spec/lib/content_buffer_spec.rb b/spec/lib/content_buffer_spec.rb
index dc5cee7f188..a6044210389 100644
--- a/spec/lib/content_buffer_spec.rb
+++ b/spec/lib/content_buffer_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'content_buffer'
describe ContentBuffer do
diff --git a/spec/lib/content_security_policy/builder_spec.rb b/spec/lib/content_security_policy/builder_spec.rb
index 68d51facb91..59e4bb505a9 100644
--- a/spec/lib/content_security_policy/builder_spec.rb
+++ b/spec/lib/content_security_policy/builder_spec.rb
@@ -1,6 +1,4 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe ContentSecurityPolicy::Builder do
let(:builder) { described_class.new(base_url: Discourse.base_url) }
diff --git a/spec/lib/content_security_policy_spec.rb b/spec/lib/content_security_policy_spec.rb
index e662f2c0fa8..bba9d45dc3e 100644
--- a/spec/lib/content_security_policy_spec.rb
+++ b/spec/lib/content_security_policy_spec.rb
@@ -1,6 +1,4 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe ContentSecurityPolicy do
after do
DiscoursePluginRegistry.reset!
diff --git a/spec/lib/cooked_post_processor_spec.rb b/spec/lib/cooked_post_processor_spec.rb
index 9de2d5b6287..72e96274e35 100644
--- a/spec/lib/cooked_post_processor_spec.rb
+++ b/spec/lib/cooked_post_processor_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
require "cooked_post_processor"
require "file_store/s3_store"
diff --git a/spec/lib/crawler_detection_spec.rb b/spec/lib/crawler_detection_spec.rb
index 58d7926b138..98a31fa8a53 100644
--- a/spec/lib/crawler_detection_spec.rb
+++ b/spec/lib/crawler_detection_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe CrawlerDetection do
def crawler!(user_agent, via = nil)
diff --git a/spec/lib/current_user_spec.rb b/spec/lib/current_user_spec.rb
index e8ec24118c0..41beb1f0d61 100644
--- a/spec/lib/current_user_spec.rb
+++ b/spec/lib/current_user_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe CurrentUser do
it "allows us to lookup a user from our environment" do
user = Fabricate(:user, active: true)
diff --git a/spec/lib/db_helper_spec.rb b/spec/lib/db_helper_spec.rb
index c2074a0f80b..03d16081afc 100644
--- a/spec/lib/db_helper_spec.rb
+++ b/spec/lib/db_helper_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe DbHelper do
describe '.remap' do
it 'should remap columns properly' do
diff --git a/spec/lib/directory_helper_spec.rb b/spec/lib/directory_helper_spec.rb
index 0b2d687fd5b..cbbc79ec42d 100644
--- a/spec/lib/directory_helper_spec.rb
+++ b/spec/lib/directory_helper_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe DirectoryHelper do
class DummyClass
include DirectoryHelper
diff --git a/spec/lib/discourse_diff_spec.rb b/spec/lib/discourse_diff_spec.rb
index 7f7d61ed9dc..27596393aae 100644
--- a/spec/lib/discourse_diff_spec.rb
+++ b/spec/lib/discourse_diff_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'discourse_diff'
describe DiscourseDiff do
diff --git a/spec/lib/discourse_event_spec.rb b/spec/lib/discourse_event_spec.rb
index fe4ad080db8..fbc916a608c 100644
--- a/spec/lib/discourse_event_spec.rb
+++ b/spec/lib/discourse_event_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe DiscourseEvent do
describe "#events" do
diff --git a/spec/lib/discourse_hub_spec.rb b/spec/lib/discourse_hub_spec.rb
index eafb579a8da..2af523777f5 100644
--- a/spec/lib/discourse_hub_spec.rb
+++ b/spec/lib/discourse_hub_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe DiscourseHub do
describe '.discourse_version_check' do
it 'should return just return the json that the hub returns' do
diff --git a/spec/lib/discourse_js_processor_spec.rb b/spec/lib/discourse_js_processor_spec.rb
index 47cd59601fd..dd04584a3bc 100644
--- a/spec/lib/discourse_js_processor_spec.rb
+++ b/spec/lib/discourse_js_processor_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'discourse_js_processor'
describe DiscourseJsProcessor do
diff --git a/spec/lib/discourse_plugin_registry_spec.rb b/spec/lib/discourse_plugin_registry_spec.rb
index 0eb7547c83e..f876d5272a4 100644
--- a/spec/lib/discourse_plugin_registry_spec.rb
+++ b/spec/lib/discourse_plugin_registry_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'discourse_plugin_registry'
describe DiscoursePluginRegistry do
diff --git a/spec/lib/discourse_redis_spec.rb b/spec/lib/discourse_redis_spec.rb
index bc2e30fd959..0512ba144a0 100644
--- a/spec/lib/discourse_redis_spec.rb
+++ b/spec/lib/discourse_redis_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe DiscourseRedis do
it "ignore_readonly returns nil from a pure exception" do
result = DiscourseRedis.ignore_readonly { raise Redis::CommandError.new("READONLY") }
diff --git a/spec/lib/discourse_spec.rb b/spec/lib/discourse_spec.rb
index 2f47dd0bb5e..bdd33cf7df2 100644
--- a/spec/lib/discourse_spec.rb
+++ b/spec/lib/discourse_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'discourse'
describe Discourse do
diff --git a/spec/lib/discourse_tagging_spec.rb b/spec/lib/discourse_tagging_spec.rb
index 5ef7c3e7eec..8c5a3ebc008 100644
--- a/spec/lib/discourse_tagging_spec.rb
+++ b/spec/lib/discourse_tagging_spec.rb
@@ -1,7 +1,6 @@
# encoding: UTF-8
# frozen_string_literal: true
-require 'rails_helper'
require 'discourse_tagging'
# More tests are found in the category_tag_spec integration specs
diff --git a/spec/lib/discourse_updates_spec.rb b/spec/lib/discourse_updates_spec.rb
index dbe653f0859..59fb8b51bbb 100644
--- a/spec/lib/discourse_updates_spec.rb
+++ b/spec/lib/discourse_updates_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe DiscourseUpdates do
def stub_data(latest, missing, critical, updated_at)
DiscourseUpdates.latest_version = latest
diff --git a/spec/lib/distributed_cache_spec.rb b/spec/lib/distributed_cache_spec.rb
index 91f0022a29a..540dee32ceb 100644
--- a/spec/lib/distributed_cache_spec.rb
+++ b/spec/lib/distributed_cache_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe "DistributedCache extensions" do
let(:cache) { DistributedCache.new('mytest') }
diff --git a/spec/lib/distributed_memoizer_spec.rb b/spec/lib/distributed_memoizer_spec.rb
index 0fb9aedef67..e875422f65e 100644
--- a/spec/lib/distributed_memoizer_spec.rb
+++ b/spec/lib/distributed_memoizer_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe DistributedMemoizer do
before do
diff --git a/spec/lib/distributed_mutex_spec.rb b/spec/lib/distributed_mutex_spec.rb
index 23bfd908127..68a31595722 100644
--- a/spec/lib/distributed_mutex_spec.rb
+++ b/spec/lib/distributed_mutex_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe DistributedMutex do
let(:key) { "test_mutex_key" }
diff --git a/spec/lib/email/authentication_results_spec.rb b/spec/lib/email/authentication_results_spec.rb
index 2b4c2b3b844..4a7b257a28d 100644
--- a/spec/lib/email/authentication_results_spec.rb
+++ b/spec/lib/email/authentication_results_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
require "email/authentication_results"
describe Email::AuthenticationResults do
diff --git a/spec/lib/email/cleaner_spec.rb b/spec/lib/email/cleaner_spec.rb
index 16de564cd57..ad9e1a71d28 100644
--- a/spec/lib/email/cleaner_spec.rb
+++ b/spec/lib/email/cleaner_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
require "email/receiver"
describe Email::Cleaner do
diff --git a/spec/lib/email/email_spec.rb b/spec/lib/email/email_spec.rb
index 382c321fe15..084337a2a3f 100644
--- a/spec/lib/email/email_spec.rb
+++ b/spec/lib/email/email_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'email'
describe Email do
diff --git a/spec/lib/email/message_builder_spec.rb b/spec/lib/email/message_builder_spec.rb
index 75fe28347fa..27a16d3f88e 100644
--- a/spec/lib/email/message_builder_spec.rb
+++ b/spec/lib/email/message_builder_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'email/message_builder'
describe Email::MessageBuilder do
diff --git a/spec/lib/email/processor_spec.rb b/spec/lib/email/processor_spec.rb
index 85d41482822..b8143f69d45 100644
--- a/spec/lib/email/processor_spec.rb
+++ b/spec/lib/email/processor_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
require "email/processor"
describe Email::Processor do
diff --git a/spec/lib/email/receiver_spec.rb b/spec/lib/email/receiver_spec.rb
index c152e173254..1123864fc9b 100644
--- a/spec/lib/email/receiver_spec.rb
+++ b/spec/lib/email/receiver_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
require "email/receiver"
describe Email::Receiver do
diff --git a/spec/lib/email/renderer_spec.rb b/spec/lib/email/renderer_spec.rb
index 3cd6df6124c..78df067afd0 100644
--- a/spec/lib/email/renderer_spec.rb
+++ b/spec/lib/email/renderer_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'email/renderer'
describe Email::Renderer do
diff --git a/spec/lib/email/sender_spec.rb b/spec/lib/email/sender_spec.rb
index cfad24c9295..255753263ef 100644
--- a/spec/lib/email/sender_spec.rb
+++ b/spec/lib/email/sender_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'email/sender'
describe Email::Sender do
diff --git a/spec/lib/email/styles_spec.rb b/spec/lib/email/styles_spec.rb
index be5b634d54e..0b82af62d8b 100644
--- a/spec/lib/email/styles_spec.rb
+++ b/spec/lib/email/styles_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'email'
describe Email::Styles do
diff --git a/spec/lib/email_cook_spec.rb b/spec/lib/email_cook_spec.rb
index f120233ce5c..128a23502bd 100644
--- a/spec/lib/email_cook_spec.rb
+++ b/spec/lib/email_cook_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'email_cook'
require 'pretty_text'
diff --git a/spec/lib/email_updater_spec.rb b/spec/lib/email_updater_spec.rb
index e3294c9c279..a407383802b 100644
--- a/spec/lib/email_updater_spec.rb
+++ b/spec/lib/email_updater_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe EmailUpdater do
let(:old_email) { 'old.email@example.com' }
let(:new_email) { 'new.email@example.com' }
diff --git a/spec/lib/encodings_spec.rb b/spec/lib/encodings_spec.rb
index bdbde95f3d4..5853e33a0c9 100644
--- a/spec/lib/encodings_spec.rb
+++ b/spec/lib/encodings_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Encodings do
def to_utf8(filename)
string = File.read("#{Rails.root}/spec/fixtures/encodings/#{filename}").chomp
diff --git a/spec/lib/enum_spec.rb b/spec/lib/enum_spec.rb
index 7dd92ccd5b0..c99450daea4 100644
--- a/spec/lib/enum_spec.rb
+++ b/spec/lib/enum_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'email'
describe Enum do
diff --git a/spec/lib/excerpt_parser_spec.rb b/spec/lib/excerpt_parser_spec.rb
index 61eda9941a2..d1b032c7f55 100644
--- a/spec/lib/excerpt_parser_spec.rb
+++ b/spec/lib/excerpt_parser_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
require "excerpt_parser"
describe ExcerptParser do
diff --git a/spec/lib/feed_element_installer_spec.rb b/spec/lib/feed_element_installer_spec.rb
index 92c12b40c13..4ca30dbeb85 100644
--- a/spec/lib/feed_element_installer_spec.rb
+++ b/spec/lib/feed_element_installer_spec.rb
@@ -1,8 +1,6 @@
# frozen_string_literal: true
require 'feed_element_installer'
-require 'rails_helper'
-
describe FeedElementInstaller do
describe '#install_rss_element' do
let(:raw_feed) { file_from_fixtures('feed.rss', 'feed').read }
diff --git a/spec/lib/feed_item_accessor_spec.rb b/spec/lib/feed_item_accessor_spec.rb
index 8a457d8d7ac..30293f0e83b 100644
--- a/spec/lib/feed_item_accessor_spec.rb
+++ b/spec/lib/feed_item_accessor_spec.rb
@@ -2,8 +2,6 @@
require 'rss'
require 'feed_item_accessor'
-require 'rails_helper'
-
describe FeedItemAccessor do
context 'for ATOM feed' do
let(:atom_feed) { RSS::Parser.parse(file_from_fixtures('feed.atom', 'feed'), false) }
diff --git a/spec/lib/file_helper_spec.rb b/spec/lib/file_helper_spec.rb
index 910a4c8434e..ae1d721f52d 100644
--- a/spec/lib/file_helper_spec.rb
+++ b/spec/lib/file_helper_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'file_helper'
describe FileHelper do
diff --git a/spec/lib/file_store/base_store_spec.rb b/spec/lib/file_store/base_store_spec.rb
index 05befda29a4..0a8cba20a83 100644
--- a/spec/lib/file_store/base_store_spec.rb
+++ b/spec/lib/file_store/base_store_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe FileStore::BaseStore do
fab!(:upload) { Fabricate(:upload, id: 9999, sha1: Digest::SHA1.hexdigest('9999')) }
diff --git a/spec/lib/file_store/local_store_spec.rb b/spec/lib/file_store/local_store_spec.rb
index 60ac2a59579..7a0fb175188 100644
--- a/spec/lib/file_store/local_store_spec.rb
+++ b/spec/lib/file_store/local_store_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'file_store/local_store'
describe FileStore::LocalStore do
diff --git a/spec/lib/file_store/s3_store_spec.rb b/spec/lib/file_store/s3_store_spec.rb
index ce9b9be143a..91ab3b9f109 100644
--- a/spec/lib/file_store/s3_store_spec.rb
+++ b/spec/lib/file_store/s3_store_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'file_store/s3_store'
require 'file_store/local_store'
diff --git a/spec/lib/filter_best_posts_spec.rb b/spec/lib/filter_best_posts_spec.rb
index d88a359eea7..a536b6cce0b 100644
--- a/spec/lib/filter_best_posts_spec.rb
+++ b/spec/lib/filter_best_posts_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'filter_best_posts'
require 'topic_view'
diff --git a/spec/lib/final_destination_spec.rb b/spec/lib/final_destination_spec.rb
index b1ce1a262a0..2c78f440ce8 100644
--- a/spec/lib/final_destination_spec.rb
+++ b/spec/lib/final_destination_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'final_destination'
describe FinalDestination do
diff --git a/spec/lib/flag_settings_spec.rb b/spec/lib/flag_settings_spec.rb
index 16668a8620d..6dd895ede85 100644
--- a/spec/lib/flag_settings_spec.rb
+++ b/spec/lib/flag_settings_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'flag_settings'
RSpec.describe FlagSettings do
diff --git a/spec/lib/freedom_patches/safe_buffer_spec.rb b/spec/lib/freedom_patches/safe_buffer_spec.rb
index f7653bb0b7c..0ddc769268b 100644
--- a/spec/lib/freedom_patches/safe_buffer_spec.rb
+++ b/spec/lib/freedom_patches/safe_buffer_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe ActiveSupport::SafeBuffer do
it "can cope with encoding weirdness" do
buffer = ActiveSupport::SafeBuffer.new
diff --git a/spec/lib/freedom_patches/schema_migration_details_spec.rb b/spec/lib/freedom_patches/schema_migration_details_spec.rb
index 05a7a0d9a6a..5812e865516 100644
--- a/spec/lib/freedom_patches/schema_migration_details_spec.rb
+++ b/spec/lib/freedom_patches/schema_migration_details_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe FreedomPatches::SchemaMigrationDetails do
# we usually don't really need this model so lets not clutter up with it
diff --git a/spec/lib/freedom_patches/seed_fu_spec.rb b/spec/lib/freedom_patches/seed_fu_spec.rb
index 3bb1876411a..80fd3e79f60 100644
--- a/spec/lib/freedom_patches/seed_fu_spec.rb
+++ b/spec/lib/freedom_patches/seed_fu_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe "seed-fu patch" do
it "does not modify a sequence on an existing table" do
u = User.create!(username: "test1", email: "test1@example.com")
diff --git a/spec/lib/freedom_patches/translate_accelerator_spec.rb b/spec/lib/freedom_patches/translate_accelerator_spec.rb
index 53346b92feb..c85f0ae5ff7 100644
--- a/spec/lib/freedom_patches/translate_accelerator_spec.rb
+++ b/spec/lib/freedom_patches/translate_accelerator_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe "translate accelerator" do
before do
@original_i18n_load_path = I18n.load_path.dup
diff --git a/spec/lib/gaps_spec.rb b/spec/lib/gaps_spec.rb
index 234cf1a9619..cf270d7f47d 100644
--- a/spec/lib/gaps_spec.rb
+++ b/spec/lib/gaps_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'cache'
describe Gaps do
diff --git a/spec/lib/global_path_spec.rb b/spec/lib/global_path_spec.rb
index 2a940051380..9d3f24461ff 100644
--- a/spec/lib/global_path_spec.rb
+++ b/spec/lib/global_path_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'global_path'
class GlobalPathInstance
diff --git a/spec/lib/group_email_credentials_check_spec.rb b/spec/lib/group_email_credentials_check_spec.rb
index 152fc4a1af3..4952a94c1c4 100644
--- a/spec/lib/group_email_credentials_check_spec.rb
+++ b/spec/lib/group_email_credentials_check_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'net/smtp'
require 'net/imap'
diff --git a/spec/lib/guardian/topic_guardian_spec.rb b/spec/lib/guardian/topic_guardian_spec.rb
index d7010a92ad4..538928ea464 100644
--- a/spec/lib/guardian/topic_guardian_spec.rb
+++ b/spec/lib/guardian/topic_guardian_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe TopicGuardian do
fab!(:admin) { Fabricate(:admin) }
fab!(:tl3_user) { Fabricate(:leader) }
diff --git a/spec/lib/guardian/user_guardian_spec.rb b/spec/lib/guardian/user_guardian_spec.rb
index 56b532b2984..70ef35f2891 100644
--- a/spec/lib/guardian/user_guardian_spec.rb
+++ b/spec/lib/guardian/user_guardian_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe UserGuardian do
let :user do
diff --git a/spec/lib/guardian_spec.rb b/spec/lib/guardian_spec.rb
index 3326492c3be..64d79ec2c1d 100644
--- a/spec/lib/guardian_spec.rb
+++ b/spec/lib/guardian_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
require 'guardian'
describe Guardian do
diff --git a/spec/lib/has_errors_spec.rb b/spec/lib/has_errors_spec.rb
index 5feea235ffb..1e0b63b813c 100644
--- a/spec/lib/has_errors_spec.rb
+++ b/spec/lib/has_errors_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'has_errors'
describe HasErrors do
diff --git a/spec/lib/highlight_js/highlight_js_spec.rb b/spec/lib/highlight_js/highlight_js_spec.rb
index aaf12f4c8b4..8c8da79a7f2 100644
--- a/spec/lib/highlight_js/highlight_js_spec.rb
+++ b/spec/lib/highlight_js/highlight_js_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe HighlightJs do
it 'can list languages' do
expect(HighlightJs.languages).to include('thrift')
diff --git a/spec/lib/hijack_spec.rb b/spec/lib/hijack_spec.rb
index b75e522acba..43bb9814c92 100644
--- a/spec/lib/hijack_spec.rb
+++ b/spec/lib/hijack_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Hijack do
class Hijack::Tester < ApplicationController
attr_reader :io
diff --git a/spec/lib/html_prettify_spec.rb b/spec/lib/html_prettify_spec.rb
index c6e0c8a196d..bea24b271b8 100644
--- a/spec/lib/html_prettify_spec.rb
+++ b/spec/lib/html_prettify_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'html_prettify'
describe HtmlPrettify do
diff --git a/spec/lib/html_to_markdown_spec.rb b/spec/lib/html_to_markdown_spec.rb
index f95da5c8abb..23ac121c88c 100644
--- a/spec/lib/html_to_markdown_spec.rb
+++ b/spec/lib/html_to_markdown_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'html_to_markdown'
describe HtmlToMarkdown do
diff --git a/spec/lib/i18n/discourse_i18n_spec.rb b/spec/lib/i18n/discourse_i18n_spec.rb
index 759467675dc..001c4aadb9e 100644
--- a/spec/lib/i18n/discourse_i18n_spec.rb
+++ b/spec/lib/i18n/discourse_i18n_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'i18n/backend/discourse_i18n'
require 'translation_override'
diff --git a/spec/lib/i18n/fallback_locale_list_spec.rb b/spec/lib/i18n/fallback_locale_list_spec.rb
index 6f4dc348c23..4951d7761b7 100644
--- a/spec/lib/i18n/fallback_locale_list_spec.rb
+++ b/spec/lib/i18n/fallback_locale_list_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'i18n/backend/fallback_locale_list'
describe I18n::Backend::FallbackLocaleList do
diff --git a/spec/lib/i18n/i18n_interpolation_keys_finder_spec.rb b/spec/lib/i18n/i18n_interpolation_keys_finder_spec.rb
index 46901b463dd..a19c70cc631 100644
--- a/spec/lib/i18n/i18n_interpolation_keys_finder_spec.rb
+++ b/spec/lib/i18n/i18n_interpolation_keys_finder_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require "i18n/i18n_interpolation_keys_finder"
RSpec.describe I18nInterpolationKeysFinder do
diff --git a/spec/lib/image_sizer_spec.rb b/spec/lib/image_sizer_spec.rb
index 5c41afec225..cd378a25318 100644
--- a/spec/lib/image_sizer_spec.rb
+++ b/spec/lib/image_sizer_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'image_sizer'
describe ImageSizer do
diff --git a/spec/lib/imap/providers/detector_spec.rb b/spec/lib/imap/providers/detector_spec.rb
index 0316160c3c3..e4cac7ecdce 100644
--- a/spec/lib/imap/providers/detector_spec.rb
+++ b/spec/lib/imap/providers/detector_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe Imap::Providers::Detector do
it "returns the gmail provider if the gmail imap server is used" do
config = {
diff --git a/spec/lib/imap/providers/generic_spec.rb b/spec/lib/imap/providers/generic_spec.rb
index c983fbce0a2..0a5a60a8b66 100644
--- a/spec/lib/imap/providers/generic_spec.rb
+++ b/spec/lib/imap/providers/generic_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe Imap::Providers::Generic do
fab!(:username) { "test@generic.com" }
fab!(:password) { "test1!" }
diff --git a/spec/lib/imap/providers/gmail_spec.rb b/spec/lib/imap/providers/gmail_spec.rb
index 014cd1bc1ea..bdf049acf4d 100644
--- a/spec/lib/imap/providers/gmail_spec.rb
+++ b/spec/lib/imap/providers/gmail_spec.rb
@@ -1,8 +1,6 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe Imap::Providers::Gmail do
fab!(:username) { "test@generic.com" }
fab!(:password) { "test1!" }
diff --git a/spec/lib/imap/sync_spec.rb b/spec/lib/imap/sync_spec.rb
index 3c494904bb2..37081e03507 100644
--- a/spec/lib/imap/sync_spec.rb
+++ b/spec/lib/imap/sync_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'imap/sync'
describe Imap::Sync do
diff --git a/spec/lib/import/normalize_spec.rb b/spec/lib/import/normalize_spec.rb
index b89ab8b414d..724e7ae3177 100644
--- a/spec/lib/import/normalize_spec.rb
+++ b/spec/lib/import/normalize_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Import::Normalize do
describe "#normalize_code_blocks" do
it "normalizes 2 code blocks correctly" do
diff --git a/spec/lib/inline_oneboxer_spec.rb b/spec/lib/inline_oneboxer_spec.rb
index 8f89e48a32c..9d0c4a67892 100644
--- a/spec/lib/inline_oneboxer_spec.rb
+++ b/spec/lib/inline_oneboxer_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe InlineOneboxer do
it "should return nothing with empty input" do
diff --git a/spec/lib/introduction_updater_spec.rb b/spec/lib/introduction_updater_spec.rb
index 49698e56e05..152a87cbdfa 100644
--- a/spec/lib/introduction_updater_spec.rb
+++ b/spec/lib/introduction_updater_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'introduction_updater'
describe IntroductionUpdater do
diff --git a/spec/lib/js_locale_helper_spec.rb b/spec/lib/js_locale_helper_spec.rb
index 27c8290ef90..b24f63b8d13 100644
--- a/spec/lib/js_locale_helper_spec.rb
+++ b/spec/lib/js_locale_helper_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'mini_racer'
describe JsLocaleHelper do
diff --git a/spec/lib/json_error_spec.rb b/spec/lib/json_error_spec.rb
index fdeaa6ce83d..fda4dc2c2cd 100644
--- a/spec/lib/json_error_spec.rb
+++ b/spec/lib/json_error_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
shared_examples "a generic error" do
let(:result) { creator.create_errors_json(obj) }
diff --git a/spec/lib/letter_avatar_spec.rb b/spec/lib/letter_avatar_spec.rb
index 9b2f87d3ca0..cd4f5c40494 100644
--- a/spec/lib/letter_avatar_spec.rb
+++ b/spec/lib/letter_avatar_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'letter_avatar'
describe LetterAvatar do
diff --git a/spec/lib/message_id_service_spec.rb b/spec/lib/message_id_service_spec.rb
index 7d40d6531f2..87ea7401859 100644
--- a/spec/lib/message_id_service_spec.rb
+++ b/spec/lib/message_id_service_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Email::MessageIdService do
fab!(:topic) { Fabricate(:topic) }
fab!(:post) { Fabricate(:post, topic: topic) }
diff --git a/spec/lib/method_profiler_spec.rb b/spec/lib/method_profiler_spec.rb
index df2e2fdd72a..b28802343a7 100644
--- a/spec/lib/method_profiler_spec.rb
+++ b/spec/lib/method_profiler_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe MethodProfiler do
class Sneetch
def beach
diff --git a/spec/lib/middleware/anonymous_cache_spec.rb b/spec/lib/middleware/anonymous_cache_spec.rb
index 0d7868401c0..88257a40de6 100644
--- a/spec/lib/middleware/anonymous_cache_spec.rb
+++ b/spec/lib/middleware/anonymous_cache_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Middleware::AnonymousCache do
let(:middleware) { Middleware::AnonymousCache.new(lambda { |_| [200, {}, []] }) }
diff --git a/spec/lib/middleware/discourse_public_exceptions_spec.rb b/spec/lib/middleware/discourse_public_exceptions_spec.rb
index ac1a0cc6ceb..b531213daec 100644
--- a/spec/lib/middleware/discourse_public_exceptions_spec.rb
+++ b/spec/lib/middleware/discourse_public_exceptions_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Middleware::DiscoursePublicExceptions do
before do
@orig_logger = Rails.logger
diff --git a/spec/lib/middleware/enforce_hostname_spec.rb b/spec/lib/middleware/enforce_hostname_spec.rb
index 1a065ebdaa8..22d8834a744 100644
--- a/spec/lib/middleware/enforce_hostname_spec.rb
+++ b/spec/lib/middleware/enforce_hostname_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Middleware::EnforceHostname do
before do
diff --git a/spec/lib/middleware/request_tracker_spec.rb b/spec/lib/middleware/request_tracker_spec.rb
index ff787c66f19..9c87b7e2677 100644
--- a/spec/lib/middleware/request_tracker_spec.rb
+++ b/spec/lib/middleware/request_tracker_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Middleware::RequestTracker do
def env(opts = {})
create_request_env.merge(
diff --git a/spec/lib/migration/column_dropper_spec.rb b/spec/lib/migration/column_dropper_spec.rb
index 4dd4758633a..1aa0a359b04 100644
--- a/spec/lib/migration/column_dropper_spec.rb
+++ b/spec/lib/migration/column_dropper_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
RSpec.describe Migration::ColumnDropper do
def has_column?(table, column)
DB.exec(<<~SQL, table: table, column: column) == 1
diff --git a/spec/lib/migration/safe_migrate_spec.rb b/spec/lib/migration/safe_migrate_spec.rb
index cec7b9710b6..5ab63616c5b 100644
--- a/spec/lib/migration/safe_migrate_spec.rb
+++ b/spec/lib/migration/safe_migrate_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Migration::SafeMigrate do
before do
Migration::SafeMigrate::SafeMigration.disable_safe!
diff --git a/spec/lib/migration/table_dropper_spec.rb b/spec/lib/migration/table_dropper_spec.rb
index 9966aeb3e87..dc5397e141b 100644
--- a/spec/lib/migration/table_dropper_spec.rb
+++ b/spec/lib/migration/table_dropper_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe Migration::TableDropper do
def table_exists?(table_name)
diff --git a/spec/lib/mini_sql_multisite_connection_spec.rb b/spec/lib/mini_sql_multisite_connection_spec.rb
index 3534f5e34fc..6072593ded9 100644
--- a/spec/lib/mini_sql_multisite_connection_spec.rb
+++ b/spec/lib/mini_sql_multisite_connection_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
-
describe MiniSqlMultisiteConnection do
describe "after_commit" do
diff --git a/spec/lib/new_post_manager_spec.rb b/spec/lib/new_post_manager_spec.rb
index ff7085f4d38..5344e328d07 100644
--- a/spec/lib/new_post_manager_spec.rb
+++ b/spec/lib/new_post_manager_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'new_post_manager'
describe NewPostManager do
diff --git a/spec/lib/new_post_result_spec.rb b/spec/lib/new_post_result_spec.rb
index 14358c623e5..ad1f94f918f 100644
--- a/spec/lib/new_post_result_spec.rb
+++ b/spec/lib/new_post_result_spec.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'rails_helper'
require 'new_post_result'
describe NewPostResult do
diff --git a/spec/lib/onebox/domain_checker_spec.rb b/spec/lib/onebox/domain_checker_spec.rb
index 0132babc746..aa4bd04338d 100644
--- a/spec/lib/onebox/domain_checker_spec.rb
+++ b/spec/lib/onebox/domain_checker_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Onebox::DomainChecker do
describe '.is_blocked?' do
before do
diff --git a/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb b/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb
index 8c625211248..b46b2450d3a 100644
--- a/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb
+++ b/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Onebox::Engine::AllowlistedGenericOnebox do
describe ".===" do
it "matches any domain" do
diff --git a/spec/lib/onebox/engine/amazon_onebox_spec.rb b/spec/lib/onebox/engine/amazon_onebox_spec.rb
index 9cf409bc057..6f3f882457c 100644
--- a/spec/lib/onebox/engine/amazon_onebox_spec.rb
+++ b/spec/lib/onebox/engine/amazon_onebox_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Onebox::Engine::AmazonOnebox do
context "regular amazon page" do
before do
diff --git a/spec/lib/onebox/engine/animated_image_onebox_spec.rb b/spec/lib/onebox/engine/animated_image_onebox_spec.rb
index b5cb9710c36..49796b91fe4 100644
--- a/spec/lib/onebox/engine/animated_image_onebox_spec.rb
+++ b/spec/lib/onebox/engine/animated_image_onebox_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Onebox::Engine::AnimatedImageOnebox do
let(:giphy) { "http://gph.is/15bRbWf" }
let(:direct_gif) { "https://media4.giphy.com/media/Zatyu5LBO2zCyhiAAs/giphy.gif" }
diff --git a/spec/lib/onebox/engine/audio_onebox_spec.rb b/spec/lib/onebox/engine/audio_onebox_spec.rb
index dbb12ad6de5..a7054f908df 100644
--- a/spec/lib/onebox/engine/audio_onebox_spec.rb
+++ b/spec/lib/onebox/engine/audio_onebox_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "rails_helper"
-
describe Onebox::Engine::AudioOnebox do
it "supports ogg" do
expect(Onebox.preview('http://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg').to_s).to match(/