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 # frozen_string_literal: true
require "rails_helper"
describe Chat::Mailer do describe Chat::Mailer do
fab!(:chatters_group) { Fabricate(:group) } fab!(:chatters_group) { Fabricate(:group) }
fab!(:sender) { Fabricate(:user, group_ids: [chatters_group.id], refresh_auto_groups: true) } fab!(:sender) { Fabricate(:user, group_ids: [chatters_group.id], refresh_auto_groups: true) }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
describe PrettyText do describe PrettyText 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 ::DiscoursePoll::PollsController do RSpec.describe ::DiscoursePoll::PollsController do
routes { ::DiscoursePoll::Engine.routes } routes { ::DiscoursePoll::Engine.routes }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails_helper"
require "rails/generators" require "rails/generators"
require "generators/site_setting_move_to_groups_migration/site_setting_move_to_groups_migration_generator" 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 # frozen_string_literal: true
require "rails_helper"
require "rails/generators" require "rails/generators"
require "generators/site_setting_rename_migration/site_setting_rename_migration_generator" require "generators/site_setting_rename_migration/site_setting_rename_migration_generator"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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