mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 03:42:41 +08:00
parent
e2129dc07c
commit
a4c2653db8
|
@ -467,7 +467,7 @@ GEM
|
|||
parser (>= 3.3.1.0)
|
||||
rubocop-capybara (2.21.0)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-discourse (3.9.0)
|
||||
rubocop-discourse (3.9.1)
|
||||
activesupport (>= 6.1)
|
||||
rubocop (>= 1.59.0)
|
||||
rubocop-capybara (>= 2.0.0)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
describe "Topic" do
|
||||
let!(:raw) { "this is me testing a new topic by automation" }
|
||||
let!(:title) { "This is a new topic created by automation" }
|
||||
fab!(:category) { Fabricate(:category) }
|
||||
fab!(:category)
|
||||
fab!(:tag1) { Fabricate(:tag) }
|
||||
fab!(:tag2) { Fabricate(:tag) }
|
||||
|
||||
|
|
|
@ -9,14 +9,14 @@ RSpec.describe DiscourseAutomation::Destroy do
|
|||
subject(:result) { described_class.call(params:, **dependencies) }
|
||||
|
||||
fab!(:user) { Fabricate(:admin) }
|
||||
fab!(:automation) { Fabricate(:automation) }
|
||||
fab!(:automation)
|
||||
|
||||
let(:guardian) { user.guardian }
|
||||
let(:params) { { automation_id: automation.id } }
|
||||
let(:dependencies) { { guardian: } }
|
||||
|
||||
context "when user can't destroy the automation" do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:user)
|
||||
|
||||
it { is_expected.to fail_a_policy(:can_destroy_automation) }
|
||||
end
|
||||
|
|
|
@ -78,7 +78,7 @@ describe ChatSDK::Channel do
|
|||
end
|
||||
|
||||
describe ".stop_reply" do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:user)
|
||||
fab!(:channel_1) { Fabricate(:chat_channel, threading_enabled: true) }
|
||||
fab!(:thread_1) { Fabricate(:chat_thread, channel: channel_1) }
|
||||
fab!(:client_id) do
|
||||
|
|
|
@ -55,7 +55,7 @@ describe UsersController do
|
|||
end
|
||||
|
||||
describe "#show_card" do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:user)
|
||||
fab!(:another_user) { Fabricate(:user) }
|
||||
|
||||
before do
|
||||
|
|
|
@ -248,7 +248,7 @@ describe Chat::MessageSerializer do
|
|||
end
|
||||
|
||||
context "with user status" do
|
||||
fab!(:user_status) { Fabricate(:user_status) }
|
||||
fab!(:user_status)
|
||||
fab!(:mentioned_user) { Fabricate(:user, user_status: user_status) }
|
||||
fab!(:message) do
|
||||
Fabricate(
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
RSpec.describe Chat::ThreadOriginalMessageSerializer do
|
||||
describe "#user" do
|
||||
fab!(:user_status) { Fabricate(:user_status) }
|
||||
fab!(:user_status)
|
||||
fab!(:user) { Fabricate(:user, user_status: user_status) }
|
||||
fab!(:message) { Fabricate(:chat_message, user: user) }
|
||||
|
||||
|
@ -26,7 +26,7 @@ RSpec.describe Chat::ThreadOriginalMessageSerializer do
|
|||
end
|
||||
|
||||
context "with mentions" do
|
||||
fab!(:user_status) { Fabricate(:user_status) }
|
||||
fab!(:user_status)
|
||||
fab!(:mentioned_user) { Fabricate(:user, user_status: user_status) }
|
||||
fab!(:message) do
|
||||
Fabricate(
|
||||
|
|
|
@ -60,7 +60,7 @@ RSpec.describe Chat::AutoLeaveChannels do
|
|||
|
||||
context "when the category's permission changes" do
|
||||
fab!(:user) { Fabricate(:user, trust_level: 1) }
|
||||
fab!(:group) { Fabricate(:group) }
|
||||
fab!(:group)
|
||||
fab!(:category) { Fabricate(:private_category, group:) }
|
||||
fab!(:chat_channel) { Fabricate(:chat_channel, chatable: category) }
|
||||
fab!(:uccm) { Fabricate(:user_chat_channel_membership, user:, chat_channel:) }
|
||||
|
|
|
@ -300,7 +300,7 @@ RSpec.describe Chat::CreateMessage do
|
|||
end
|
||||
|
||||
context "when membership is enforced" do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:user)
|
||||
|
||||
before do
|
||||
SiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]
|
||||
|
|
|
@ -11,7 +11,7 @@ RSpec.describe Chat::TrashMessages do
|
|||
subject(:result) { described_class.call(params:, **dependencies) }
|
||||
|
||||
fab!(:current_user) { Fabricate(:user) }
|
||||
fab!(:chat_channel) { Fabricate(:chat_channel) }
|
||||
fab!(:chat_channel)
|
||||
fab!(:message1) { Fabricate(:chat_message, user: current_user, chat_channel: chat_channel) }
|
||||
fab!(:message2) { Fabricate(:chat_message, user: current_user, chat_channel: chat_channel) }
|
||||
let(:guardian) { Guardian.new(current_user) }
|
||||
|
|
|
@ -5,7 +5,7 @@ RSpec.describe Chat::UpdateChannel do
|
|||
|
||||
fab!(:channel) { Fabricate(:chat_channel) }
|
||||
fab!(:current_user) { Fabricate(:admin) }
|
||||
fab!(:upload) { Fabricate(:upload) }
|
||||
fab!(:upload)
|
||||
|
||||
let(:guardian) { Guardian.new(current_user) }
|
||||
let(:params) do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe PostsController do
|
||||
fab!(:admin) { Fabricate(:admin) }
|
||||
fab!(:admin)
|
||||
fab!(:topic) { Fabricate(:topic, user: admin) }
|
||||
|
||||
fab!(:post1) { Fabricate(:post, topic:, raw: "[poll]\n- A\n- B\n[/poll]") }
|
||||
|
|
Loading…
Reference in New Issue
Block a user