DEV: Automatically require 'rails_helper' in all specs (#16077)

It's very easy to forget to add `require 'rails_helper'` at the top of every core/plugin spec file, and omissions can cause some very confusing/sporadic errors.

By setting this flag in `.rspec`, we can remove the need for `require 'rails_helper'` entirely.
This commit is contained in:
David Taylor 2022-03-01 17:50:50 +00:00 committed by GitHub
parent 9415ec91a1
commit c9dab6fd08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
815 changed files with 1 additions and 1487 deletions

1
.rspec
View File

@ -1 +1,2 @@
--colour --colour
--require 'rails_helper'

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe "Local Dates" do RSpec.describe "Local Dates" do
before do before do
freeze_time DateTime.parse('2018-11-10 12:00') freeze_time DateTime.parse('2018-11-10 12:00')

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
def generate_html(text, opts = {}) def generate_html(text, opts = {})
output = "<p><span" output = "<p><span"
output += " data-date=\"#{opts[:date]}\"" if opts[:date] output += " data-date=\"#{opts[:date]}\"" if opts[:date]

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Post do describe Post do
before do before do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
fab!(:narrative_bot) { ::DiscourseNarrativeBot::Base.new } fab!(:narrative_bot) { ::DiscourseNarrativeBot::Base.new }
fab!(:discobot_user) { narrative_bot.discobot_user } fab!(:discobot_user) { narrative_bot.discobot_user }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe DiscourseNarrativeBot::NewUserNarrative do describe DiscourseNarrativeBot::NewUserNarrative do
fab!(:welcome_topic) { Fabricate(:topic, title: 'Welcome to Discourse') } fab!(:welcome_topic) { Fabricate(:topic, title: 'Welcome to Discourse') }
fab!(:narrative_bot) { ::DiscourseNarrativeBot::Base.new } fab!(:narrative_bot) { ::DiscourseNarrativeBot::Base.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe DiscourseNarrativeBot::Store do describe DiscourseNarrativeBot::Store do
describe '.set' do describe '.set' do
it 'should set the right value in the plugin store' do it 'should set the right value in the plugin store' do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe DiscourseNarrativeBot::TrackSelector do describe DiscourseNarrativeBot::TrackSelector do
let(:user) { Fabricate(:user) } let(:user) { Fabricate(:user) }
let(:narrative_bot) { ::DiscourseNarrativeBot::Base.new } let(:narrative_bot) { ::DiscourseNarrativeBot::Base.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::DiscourseNarrativeBot::GrantBadges do RSpec.describe Jobs::DiscourseNarrativeBot::GrantBadges do
let(:user) { Fabricate(:user) } let(:user) { Fabricate(:user) }
let(:other_user) { Fabricate(:user) } let(:other_user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::DiscourseNarrativeBot::RemapOldBotImages do describe Jobs::DiscourseNarrativeBot::RemapOldBotImages do
context "when bot's post contains an old link" do context "when bot's post contains an old link" do
let!(:post) do let!(:post) do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::SendDefaultWelcomeMessage do RSpec.describe Jobs::SendDefaultWelcomeMessage do
let(:user) { Fabricate(:user) } let(:user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe DiscourseNarrativeBot::CertificateGenerator do RSpec.describe DiscourseNarrativeBot::CertificateGenerator do
let(:user) { Fabricate(:user) } let(:user) { Fabricate(:user) }
let(:avatar_url) { 'http://test.localhost/cdn/avatar.png' } let(:avatar_url) { 'http://test.localhost/cdn/avatar.png' }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe "Discobot Certificate" do describe "Discobot Certificate" do
let(:user) { Fabricate(:user, name: 'Jeff Atwood') } let(:user) { Fabricate(:user, name: 'Jeff Atwood') }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe "Discobot welcome post" do describe "Discobot welcome post" do
let(:user) { Fabricate(:user) } let(:user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe User do describe User do
let(:user) { Fabricate(:user) } let(:user) { Fabricate(:user) }
let(:profile_page_url) { "#{Discourse.base_url}/users/#{user.username}" } let(:profile_page_url) { "#{Discourse.base_url}/users/#{user.username}" }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe "discourse-presence" do describe "discourse-presence" do
describe 'PresenceChannel configuration' do describe 'PresenceChannel configuration' do
fab!(:user) { Fabricate(:user) } fab!(:user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe DiscoursePoll::Poll do describe DiscoursePoll::Poll do
fab!(:user) { Fabricate(:user) } fab!(:user) { Fabricate(:user) }
fab!(:user_2) { Fabricate(:user) } fab!(:user_2) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe DiscoursePoll::PollsUpdater do describe DiscoursePoll::PollsUpdater do
def update(post, polls) def update(post, polls)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe PrettyText do describe PrettyText do
def n(html) def n(html)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe ::DiscoursePoll::Poll do describe ::DiscoursePoll::Poll do
describe ".transform_for_user_field_override" do describe ".transform_for_user_field_override" do
it "Transforms UserField name if a matching CustomUserField is present" do it "Transforms UserField name if a matching CustomUserField is present" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
def serialize_option(option, user) def serialize_option(option, user)
PollOptionSerializer.new( PollOptionSerializer.new(
option, option,

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'SiteSetting.styleguide_admin_only' do describe 'SiteSetting.styleguide_admin_only' do
before do before do
SiteSetting.styleguide_enabled = true SiteSetting.styleguide_enabled = true

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'Styleguide assets' do describe 'Styleguide assets' do
before do before do
SiteSetting.styleguide_enabled = true SiteSetting.styleguide_enabled = true

View File

@ -1,8 +1,6 @@
# coding: utf-8 # coding: utf-8
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe ApplicationHelper do describe ApplicationHelper do
describe "preload_script" do describe "preload_script" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe TopicsHelper do describe TopicsHelper do
describe "#categories_breadcrumb" do describe "#categories_breadcrumb" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe UserNotificationsHelper do describe UserNotificationsHelper do
let(:upload_path) { Discourse.store.upload_path } let(:upload_path) { Discourse.store.upload_path }

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
require "import_export" require "import_export"
describe ImportExport::CategoryExporter do describe ImportExport::CategoryExporter do

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
require "import_export/category_structure_exporter" require "import_export/category_structure_exporter"
describe ImportExport::CategoryStructureExporter do describe ImportExport::CategoryStructureExporter do

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
require "import_export/group_exporter" require "import_export/group_exporter"
describe ImportExport::GroupExporter do describe ImportExport::GroupExporter do

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
require "import_export" require "import_export"
describe ImportExport::Importer do describe ImportExport::Importer do

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
require "import_export" require "import_export"
describe ImportExport::TopicExporter do describe ImportExport::TopicExporter do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'Setting changes' do describe 'Setting changes' do
describe '#must_approve_users' do describe '#must_approve_users' do
before { SiteSetting.must_approve_users = false } before { SiteSetting.must_approve_users = false }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'api keys' do describe 'api keys' do
let(:user) { Fabricate(:user) } let(:user) { Fabricate(:user) }
let(:api_key) { ApiKey.create!(user_id: user.id, created_by_id: Discourse.system_user) } let(:api_key) { ApiKey.create!(user_id: user.id, created_by_id: Discourse.system_user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe "auto reject reviewable users" do describe "auto reject reviewable users" do
context "reviewable users" do context "reviewable users" do
fab!(:old_user) { Fabricate(:reviewable, created_at: 80.days.ago) } fab!(:old_user) { Fabricate(:reviewable, created_at: 80.days.ago) }

View File

@ -1,8 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe "category tag restrictions" do describe "category tag restrictions" do
def filter_allowed_tags(opts = {}) def filter_allowed_tags(opts = {})

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'content security policy integration' do describe 'content security policy integration' do
it "adds the csp headers correctly" do it "adds the csp headers correctly" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
describe EmailStyle do describe EmailStyle do
context "ERB evaluation" do context "ERB evaluation" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
describe PostAction do describe PostAction do
it "triggers the 'flag_reviewed' event when there was at least one flag" do it "triggers the 'flag_reviewed' event when there was at least one flag" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Group do describe Group do
let(:group) do let(:group) do
Fabricate( Fabricate(

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'invalid requests', type: :request do describe 'invalid requests', type: :request do
before do before do
@orig_logger = Rails.logger @orig_logger = Rails.logger

View File

@ -1,8 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'invite only' do describe 'invite only' do
describe '#create invite only' do describe '#create invite only' do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'message bus integration' do describe 'message bus integration' do
it "allows anonymous requests to the messagebus" do it "allows anonymous requests to the messagebus" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'multisite', type: [:multisite, :request] do describe 'multisite', type: [:multisite, :request] do
it "works" do it "works" do
get "http://test.localhost/session/csrf.json" get "http://test.localhost/session/csrf.json"

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'multisite', type: [:multisite, :request] do describe 'multisite', type: [:multisite, :request] do
it "should always allow /srv/status through" do it "should always allow /srv/status through" do
get "http://unknown.com/srv/status" get "http://unknown.com/srv/status"

View File

@ -1,8 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe 'rate limiter integration' do describe 'rate limiter integration' do
before do before do

View File

@ -1,8 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe "spammers on same IP" do describe "spammers on same IP" do
let(:ip_address) { '182.189.119.174' } let(:ip_address) { '182.189.119.174' }

View File

@ -1,8 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe "spam rules for users" do describe "spam rules for users" do
describe 'auto-silence users based on flagging' do describe 'auto-silence users based on flagging' do

View File

@ -1,8 +1,6 @@
# encoding: UTF-8 # encoding: UTF-8
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Topic do describe Topic do
let(:job_klass) { Jobs::CloseTopic } let(:job_klass) { Jobs::CloseTopic }

View File

@ -1,6 +1,4 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe "Topic Thumbnails" do describe "Topic Thumbnails" do
before do before do
SiteSetting.create_thumbnails = true SiteSetting.create_thumbnails = true

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe WatchedWord do describe WatchedWord do
fab!(:tl2_user) { Fabricate(:user, trust_level: TrustLevel[2]) } fab!(:tl2_user) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:admin) { Fabricate(:admin) } fab!(:admin) { Fabricate(:admin) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
def list_files(base_dir, pattern = '*') def list_files(base_dir, pattern = '*')
Dir[File.join("#{base_dir}", pattern)] Dir[File.join("#{base_dir}", pattern)]
end end

View File

@ -1,6 +1,4 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe "CommonMark" do describe "CommonMark" do
it 'passes spec' do it 'passes spec' do

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
require "i18n/duplicate_key_finder" require "i18n/duplicate_key_finder"
def extract_locale(path) def extract_locale(path)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
describe "constants match ruby" do describe "constants match ruby" do
let(:ctx) { MiniRacer::Context.new } let(:ctx) { MiniRacer::Context.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
describe 'Oj' do describe 'Oj' do
it "is enabled" do it "is enabled" do
classes = Set.new classes = Set.new

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
describe ::Jobs::Onceoff do describe ::Jobs::Onceoff do
it "can run all once off jobs without errors" do it "can run all once off jobs without errors" do
# Load all once offs # Load all once offs

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
require "i18n/duplicate_key_finder" require "i18n/duplicate_key_finder"
describe "site setting integrity checks" do describe "site setting integrity checks" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::AboutStats do describe Jobs::AboutStats do
it 'caches the stats' do it 'caches the stats' do
begin begin

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::ActivationReminderEmails do describe Jobs::ActivationReminderEmails do
before { Jobs.run_immediately! } before { Jobs.run_immediately! }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::AutoExpireUserApiKeys do RSpec.describe Jobs::AutoExpireUserApiKeys do
fab!(:key1) { Fabricate(:readonly_user_api_key) } fab!(:key1) { Fabricate(:readonly_user_api_key) }
fab!(:key2) { Fabricate(:readonly_user_api_key) } fab!(:key2) { Fabricate(:readonly_user_api_key) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::AutoQueueHandler do describe Jobs::AutoQueueHandler do
subject { Jobs::AutoQueueHandler.new.execute({}) } subject { Jobs::AutoQueueHandler.new.execute({}) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::AutomaticGroupMembership do describe Jobs::AutomaticGroupMembership do
it "raises an error when the group id is missing" do it "raises an error when the group id is missing" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::BookmarkReminderNotifications do RSpec.describe Jobs::BookmarkReminderNotifications do
subject { described_class.new } subject { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::BulkGrantTrustLevel do describe Jobs::BulkGrantTrustLevel do
it "raises an error when trust_level is missing" do it "raises an error when trust_level is missing" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::BulkInvite do describe Jobs::BulkInvite do
describe '#execute' do describe '#execute' do
fab!(:user) { Fabricate(:user) } fab!(:user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::BumpTopic do describe Jobs::BumpTopic do
fab!(:admin) { Fabricate(:admin) } fab!(:admin) { Fabricate(:admin) }
fab!(:user) { Fabricate(:user) } fab!(:user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CleanDismissedTopicUsers do describe Jobs::CleanDismissedTopicUsers do
fab!(:user) { Fabricate(:user, created_at: 1.days.ago, previous_visit_at: 1.days.ago) } fab!(:user) { Fabricate(:user, created_at: 1.days.ago, previous_visit_at: 1.days.ago) }
fab!(:topic) { Fabricate(:topic, created_at: 5.hours.ago) } fab!(:topic) { Fabricate(:topic, created_at: 5.hours.ago) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CleanUpAssociatedAccounts do describe Jobs::CleanUpAssociatedAccounts do
subject { Jobs::CleanUpAssociatedAccounts.new.execute({}) } subject { Jobs::CleanUpAssociatedAccounts.new.execute({}) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CleanUpCrawlerStats do describe Jobs::CleanUpCrawlerStats do
subject { Jobs::CleanUpCrawlerStats.new.execute({}) } subject { Jobs::CleanUpCrawlerStats.new.execute({}) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CleanUpEmailChangeRequests do describe Jobs::CleanUpEmailChangeRequests do
it "deletes records older than 1 month" do it "deletes records older than 1 month" do
very_old = Fabricate(:email_change_request, updated_at: 32.days.ago) very_old = Fabricate(:email_change_request, updated_at: 32.days.ago)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CleanUpEmailLogs do describe Jobs::CleanUpEmailLogs do
fab!(:email_log) { Fabricate(:email_log, created_at: 2.years.ago) } fab!(:email_log) { Fabricate(:email_log, created_at: 2.years.ago) }
fab!(:email_log2) { Fabricate(:email_log, created_at: 2.weeks.ago) } fab!(:email_log2) { Fabricate(:email_log, created_at: 2.weeks.ago) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::CleanUpInactiveUsers do RSpec.describe Jobs::CleanUpInactiveUsers do
it "should clean up new users that have been inactive" do it "should clean up new users that have been inactive" do
SiteSetting.clean_up_inactive_users_after_days = 0 SiteSetting.clean_up_inactive_users_after_days = 0

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::CleanUpPostReplyKeys do RSpec.describe Jobs::CleanUpPostReplyKeys do
it 'removes old post_reply_keys' do it 'removes old post_reply_keys' do
freeze_time freeze_time

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::CleanUpUnusedStagedUsers do RSpec.describe Jobs::CleanUpUnusedStagedUsers do
fab!(:staged_user) { Fabricate(:user, staged: true) } fab!(:staged_user) { Fabricate(:user, staged: true) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CleanUpUploads do describe Jobs::CleanUpUploads do
def fabricate_upload(attributes = {}) def fabricate_upload(attributes = {})

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::CleanUpUserExportTopics do RSpec.describe Jobs::CleanUpUserExportTopics do
fab!(:user) { Fabricate(:user) } fab!(:user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CleanupImapSyncLog do describe Jobs::CleanupImapSyncLog do
let(:job_class) { Jobs::CleanupImapSyncLog.new } let(:job_class) { Jobs::CleanupImapSyncLog.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CloseTopic do describe Jobs::CloseTopic do
fab!(:admin) { Fabricate(:admin) } fab!(:admin) { Fabricate(:admin) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CorrectMissingDualstackUrls do describe Jobs::CorrectMissingDualstackUrls do
it 'corrects the urls' do it 'corrects the urls' do
setup_s3 setup_s3

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CrawlTopicLink do describe Jobs::CrawlTopicLink do
let(:job) { Jobs::CrawlTopicLink.new } let(:job) { Jobs::CrawlTopicLink.new }

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
require 'jobs/regular/create_linked_topic' require 'jobs/regular/create_linked_topic'
describe Jobs::CreateLinkedTopic do describe Jobs::CreateLinkedTopic do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CreateMissingAvatars do describe Jobs::CreateMissingAvatars do
it "runs correctly without crashing" do it "runs correctly without crashing" do
Jobs::CreateMissingAvatars.new.execute(nil) Jobs::CreateMissingAvatars.new.execute(nil)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CreateRecentPostSearchIndexes do describe Jobs::CreateRecentPostSearchIndexes do
subject { described_class.new } subject { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::CreateUserReviewable do describe Jobs::CreateUserReviewable do
let(:user) { Fabricate(:user) } let(:user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe ::Jobs::DashboardStats do describe ::Jobs::DashboardStats do
let(:group_message) { GroupMessage.new(Group[:admins].name, :dashboard_problems, limit_once_per: 7.days.to_i) } let(:group_message) { GroupMessage.new(Group[:admins].name, :dashboard_problems, limit_once_per: 7.days.to_i) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::DeleteReplies do describe Jobs::DeleteReplies do
fab!(:admin) { Fabricate(:admin) } fab!(:admin) { Fabricate(:admin) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::DeleteTopic do describe Jobs::DeleteTopic do
fab!(:admin) { Fabricate(:admin) } fab!(:admin) { Fabricate(:admin) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::DisableBootstrapMode do describe Jobs::DisableBootstrapMode do
context '.execute' do context '.execute' do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::DownloadAvatarFromUrl do RSpec.describe Jobs::DownloadAvatarFromUrl do
fab!(:user) { Fabricate(:user) } fab!(:user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::DownloadBackupEmail do RSpec.describe Jobs::DownloadBackupEmail do
fab!(:user) { Fabricate(:admin) } fab!(:user) { Fabricate(:admin) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::DownloadProfileBackgroundFromUrl do RSpec.describe Jobs::DownloadProfileBackgroundFromUrl do
fab!(:user) { Fabricate(:user) } fab!(:user) { Fabricate(:user) }

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
require 'excon' require 'excon'
describe Jobs::EmitWebHookEvent do describe Jobs::EmitWebHookEvent do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::EnableBootstrapMode do describe Jobs::EnableBootstrapMode do
context '.execute' do context '.execute' do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::EnqueueDigestEmails do describe Jobs::EnqueueDigestEmails do
describe '#target_users' do describe '#target_users' do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::EnqueueSuspectUsers do describe Jobs::EnqueueSuspectUsers do
before { SiteSetting.approve_suspect_users = true } before { SiteSetting.approve_suspect_users = true }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::EnsureS3UploadsExistence do RSpec.describe Jobs::EnsureS3UploadsExistence do
context "S3 inventory enabled" do context "S3 inventory enabled" do
before do before do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
describe Jobs::ExportCsvFile do describe Jobs::ExportCsvFile do
context '#execute' do context '#execute' do

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
require 'csv' require 'csv'
describe Jobs::ExportUserArchive do describe Jobs::ExportUserArchive do

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
require 'jobs/regular/process_post' require 'jobs/regular/process_post'
describe Jobs::FeatureTopicUsers do describe Jobs::FeatureTopicUsers do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Jobs::FixOutOfSyncUserUploadedAvatar do RSpec.describe Jobs::FixOutOfSyncUserUploadedAvatar do
it 'should fix out of sync user uploaded avatars' do it 'should fix out of sync user uploaded avatars' do
user_with_custom_upload = Fabricate(:user) user_with_custom_upload = Fabricate(:user)

Some files were not shown because too many files have changed in this diff Show More