DEV: Remove unnecessary rails_helper requiring (#26364)

This commit is contained in:
Jarek Radosz 2024-03-26 11:32:01 +01:00 committed by GitHub
parent 5adfb299ac
commit 4c860995e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
105 changed files with 0 additions and 205 deletions

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Mailer do
fab!(:chatters_group) { Fabricate(:group) }
fab!(:sender) { Fabricate(:user, group_ids: [chatters_group.id], refresh_auto_groups: true) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::MessageRateLimiter do
fab!(:user) { Fabricate(:user, trust_level: 3) }
let(:limiter) { described_class.new(user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Seeder do
fab!(:staff_category) { Fabricate(:private_category, name: "Staff", group: Group[:staff]) }
fab!(:general_category) { Fabricate(:category, name: "General") }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe "API keys scoped to chat#create_message" do
before do
SiteSetting.chat_enabled = true

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe "Plugin API for chat" do
before { SiteSetting.chat_enabled = true }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Jobs::Chat::AutoJoinChannelBatch do
it "can successfully queue this job" do
expect {

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Jobs::Chat::AutoJoinChannelMemberships do
let(:user) { Fabricate(:user, last_seen_at: 15.minutes.ago) }
let(:category) { Fabricate(:category, user: user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Jobs::Chat::ChannelArchive do
fab!(:chat_channel) { Fabricate(:category_channel) }
fab!(:user) { Fabricate(:user, admin: true) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Jobs::Chat::NotifyMentioned do
subject(:job) { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Jobs::Chat::ProcessMessage do
fab!(:chat_message) { Fabricate(:chat_message, message: "https://discourse.org/team") }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Jobs::Chat::AutoJoinUsers do
subject(:job) { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Jobs::Chat::DeleteOldMessages do
base_date = DateTime.parse("2020-12-01 00:00 UTC")

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::ChannelArchiveService do
class FakeArchiveError < StandardError
end

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::DuplicateMessageValidator do
let(:chat_channel) { Fabricate(:chat_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::GuardianExtensions do
fab!(:chatters) { Fabricate(:group) }
fab!(:user) { Fabricate(:user, group_ids: [chatters.id], refresh_auto_groups: true) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::MessageBookmarkable do
subject(:registered_bookmarkable) { RegisteredBookmarkable.new(described_class) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::MessageMover do
fab!(:acting_user) { Fabricate(:admin, username: "testmovechat") }
fab!(:source_channel) { Fabricate(:category_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::MessageReactor do
subject(:message_reactor) { described_class.new(reacting_user, channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Notifier do
describe "#notify_new" do
fab!(:channel) { Fabricate(:category_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::OneboxHandler do
fab!(:private_category) { Fabricate(:private_category, group: Fabricate(:group)) }
fab!(:private_channel) { Fabricate(:category_channel, chatable: private_category) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::ParsedMentions do
fab!(:channel_member_1) { Fabricate(:user) }
fab!(:channel_member_2) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::PostNotificationHandler do
subject(:handler) { described_class.new(post, notified_users) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::ReviewQueue do
subject(:queue) { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::SlackCompatibility do
describe "#process_text" do
it "converts mrkdwn links to regular markdown" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::TranscriptService do
let(:acting_user) { Fabricate(:user) }
let(:user1) { Fabricate(:user, username: "martinchat") }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Types::Array do
subject(:type) { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe ChatSDK::Channel do
describe ".messages" do
fab!(:channel_1) { Fabricate(:chat_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe ChatSDK::Message do
describe ".create" do
fab!(:channel_1) { Fabricate(:chat_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe ChatSDK::Thread do
describe ".update_title" do
fab!(:thread_1) { Fabricate(:chat_thread) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe UserNotifications do
fab!(:chatters_group) { Fabricate(:group) }
fab!(:sender) { Fabricate(:user, group_ids: [chatters_group.id], refresh_auto_groups: true) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Category do
it_behaves_like "a chatable model" do
fab!(:chatable) { Fabricate(:category) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::DirectMessage do
fab!(:user1) { Fabricate(:user, username: "chatdmfellow1") }
fab!(:user2) { Fabricate(:user, username: "chatdmuser") }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Message do
fab!(:message) { Fabricate(:chat_message, message: "hey friend, what's up?!") }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::NullMessage do
subject(:null_message) { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::NullUser do
subject(:null_user) { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::ReviewableMessage, type: :model do
fab!(:moderator)
fab!(:user)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe UserOption do
describe "#chat_separate_sidebar_mode" do
it "is present" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe User do
it { is_expected.to have_many(:user_chat_channel_memberships).dependent(:destroy) }
it { is_expected.to have_many(:chat_message_reactions).dependent(:destroy) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat do
before do
SiteSetting.clean_up_uploads = true

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::ChannelMembershipsQuery do
fab!(:user_1) { Fabricate(:user, username: "Aline", name: "Boetie") }
fab!(:user_2) { Fabricate(:user, username: "Bertrand", name: "Arlan") }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::ChannelUnreadsQuery do
subject(:query) do
described_class.call(

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::ThreadUnreadsQuery do
subject(:query) do
described_class.call(

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::UsersFromUsernamesAndGroupsQuery do
fab!(:user1) { Fabricate(:user) }
fab!(:user2) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::ChatController do
describe "#export_messages" do
fab!(:user)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe ApplicationController do
fab!(:user)
fab!(:admin)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Admin::IncomingWebhooksController do
fab!(:admin)
fab!(:user)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Api::CategoryChatablesController do
describe "#access_by_category" do
fab!(:group)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChannelMessagesController do
fab!(:current_user) { Fabricate(:user) }
fab!(:channel) { Fabricate(:chat_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChannelThreadMessagesController do
fab!(:current_user) { Fabricate(:user) }
fab!(:thread) do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChannelThreadsController do
fab!(:current_user) { Fabricate(:user) }
fab!(:public_channel) { Fabricate(:chat_channel, threading_enabled: true) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChannelsArchivesController do
fab!(:user)
fab!(:admin)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChannelsController do
before do
SiteSetting.chat_enabled = true

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Api::ChannelsCurrentUserMembershipController do
fab!(:current_user) { Fabricate(:user) }
fab!(:channel_1) { Fabricate(:category_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Api::ChannelsCurrentUserMembershipController do
fab!(:current_user) { Fabricate(:user) }
fab!(:channel_1) { Fabricate(:category_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChannelsInvitesController do
fab!(:current_user) { Fabricate(:user) }
fab!(:channel_1) { Fabricate(:chat_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChannelsMessagesStreamingController do
fab!(:channel_1) { Fabricate(:chat_channel) }
fab!(:current_user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChannelsMessagesMovesController do
fab!(:channel) { Fabricate(:category_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChannelsStatusController do
fab!(:channel_1) { Fabricate(:category_channel, status: :open) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::Api::ChatablesController do
before do
SiteSetting.chat_enabled = true

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Api::CurrentUserChannelsController do
fab!(:current_user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Api::CurrentUserThreadsController do
fab!(:current_user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::IncomingWebhooksController do
fab!(:chat_channel) { Fabricate(:category_channel) }
fab!(:webhook) { Fabricate(:incoming_chat_webhook, chat_channel: chat_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::ChatController do
fab!(:user)
fab!(:other_user) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe EmailController do
describe "unsubscribing from chat email settings" do
fab!(:user)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::DirectMessagesController do
fab!(:user)
fab!(:user1) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::EmojisController do
fab!(:user_1) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::ChannelSerializer do
subject(:serializer) { described_class.new(chat_channel, scope: guardian, root: nil) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::MessageSerializer do
subject(:serializer) { described_class.new(message_1, scope: guardian, root: nil) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::MessageUserSerializer do
subject(:serializer) do
user = Fabricate(:user, **params)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::ThreadOriginalMessageSerializer do
subject(:serializer) { described_class.new(message_1, scope: guardian, root: nil) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::ChatablesSerializer do
context "with status" do
fab!(:user_1) { Fabricate(:user) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::DirectMessageSerializer do
describe "#user" do
it "returns you when there are two of us" do

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::InReplyToSerializer do
subject(:serializer) { described_class.new(message, scope: guardian, root: nil) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Chat::ThreadOriginalMessageSerializer do
describe "#user" do
fab!(:user_status) { Fabricate(:user_status) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::AutoJoinChannelBatch do
describe Chat::AutoJoinChannelBatch::Contract, type: :model do
subject(:contract) { described_class.new(start_user_id: 10) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::Publisher do
fab!(:channel) { Fabricate(:category_channel) }
fab!(:message_1) { Fabricate(:chat_message, chat_channel: channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Chat::DefaultChannelValidator do
fab!(:channel) { Fabricate(:category_channel) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe PrettyText do
describe "markdown it" do
it "can properly bake boxes" do

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
require "pretty_text"
RSpec.describe PrettyText do

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
require "pretty_text"
RSpec.describe PrettyText do

View File

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

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe ::DiscoursePoll::PollsController do
routes { ::DiscoursePoll::Engine.routes }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe PostsController do
let!(:user) { Fabricate(:user, refresh_auto_groups: true) }
let!(:title) { "Testing Poll Plugin" }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe "DiscoursePoll endpoints" do
describe "fetch voters for a poll" do
fab!(:user)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Jobs::ClosePoll do
let(:post) { Fabricate(:post, raw: "[poll]\n- A\n- B\n[/poll]") }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe NewPostManager do
let(:user) { Fabricate(:newuser, refresh_auto_groups: true) }
let(:admin) { Fabricate(:admin, refresh_auto_groups: true) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe ::DiscoursePoll::PollsValidator do
subject(:validator) { described_class.new(post) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe PostsController do
let(:admin) { Fabricate(:admin) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Admin::UsersController do
let(:admin) { Fabricate(:admin) }

View File

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

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe PrettyText do
it "should remove spoilers from excerpts" do
expect(

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
require "rails/generators"
require "generators/site_setting_move_to_groups_migration/site_setting_move_to_groups_migration_generator"

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
require "rails/generators"
require "generators/site_setting_rename_migration/site_setting_rename_migration_generator"

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe Jobs::CleanUpTags do
subject(:job) { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Jobs::UpdatePostUploadsSecureStatus do
fab!(:post)

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Jobs::SyncAclsForUploads do
let(:upload1) { Fabricate(:upload) }
let(:upload2) { Fabricate(:upload) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe FormTemplateYamlValidator, type: :validator do
subject(:validator) { described_class.new }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe BadgeGrouping, type: :model do
it { is_expected.to validate_length_of(:name).is_at_most(100) }
it { is_expected.to validate_length_of(:description).is_at_most(500) }

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe FormTemplate, type: :model do
it "can't have duplicate names" do
Fabricate(:form_template, name: "Bug Report", template: "- type: input\n id: name")

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Sitemap do
describe ".regenerate_sitemaps" do
fab!(:topic)

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