diff --git a/Gemfile.lock b/Gemfile.lock index e65dc04ff12..ac87062258b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) diff --git a/plugins/automation/spec/scripts/topic_spec.rb b/plugins/automation/spec/scripts/topic_spec.rb index 93ac44bb9d9..13318c05dc5 100644 --- a/plugins/automation/spec/scripts/topic_spec.rb +++ b/plugins/automation/spec/scripts/topic_spec.rb @@ -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) } diff --git a/plugins/automation/spec/services/discourse_automation/destroy_spec.rb b/plugins/automation/spec/services/discourse_automation/destroy_spec.rb index 09662498612..c5f48188343 100644 --- a/plugins/automation/spec/services/discourse_automation/destroy_spec.rb +++ b/plugins/automation/spec/services/discourse_automation/destroy_spec.rb @@ -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 diff --git a/plugins/chat/spec/lib/chat_sdk/channel_spec.rb b/plugins/chat/spec/lib/chat_sdk/channel_spec.rb index 7af2f51104d..b09ee6b975b 100644 --- a/plugins/chat/spec/lib/chat_sdk/channel_spec.rb +++ b/plugins/chat/spec/lib/chat_sdk/channel_spec.rb @@ -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 diff --git a/plugins/chat/spec/requests/core_ext/users_controller_spec.rb b/plugins/chat/spec/requests/core_ext/users_controller_spec.rb index 3b9e6538c1b..ed81b27c192 100644 --- a/plugins/chat/spec/requests/core_ext/users_controller_spec.rb +++ b/plugins/chat/spec/requests/core_ext/users_controller_spec.rb @@ -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 diff --git a/plugins/chat/spec/serializer/chat/chat_message_serializer_spec.rb b/plugins/chat/spec/serializer/chat/chat_message_serializer_spec.rb index d8e516f7478..ba5dede8f53 100644 --- a/plugins/chat/spec/serializer/chat/chat_message_serializer_spec.rb +++ b/plugins/chat/spec/serializer/chat/chat_message_serializer_spec.rb @@ -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( diff --git a/plugins/chat/spec/serializer/chat/thread_original_message_serializer_spec.rb b/plugins/chat/spec/serializer/chat/thread_original_message_serializer_spec.rb index 10814e95cf0..5d17fae7766 100644 --- a/plugins/chat/spec/serializer/chat/thread_original_message_serializer_spec.rb +++ b/plugins/chat/spec/serializer/chat/thread_original_message_serializer_spec.rb @@ -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( diff --git a/plugins/chat/spec/services/chat/auto_leave_channels_spec.rb b/plugins/chat/spec/services/chat/auto_leave_channels_spec.rb index 0397ae625be..9cfa8b0fc04 100644 --- a/plugins/chat/spec/services/chat/auto_leave_channels_spec.rb +++ b/plugins/chat/spec/services/chat/auto_leave_channels_spec.rb @@ -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:) } diff --git a/plugins/chat/spec/services/chat/create_message_spec.rb b/plugins/chat/spec/services/chat/create_message_spec.rb index bb3ea888187..0800c6ab213 100644 --- a/plugins/chat/spec/services/chat/create_message_spec.rb +++ b/plugins/chat/spec/services/chat/create_message_spec.rb @@ -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] diff --git a/plugins/chat/spec/services/chat/trash_messages_spec.rb b/plugins/chat/spec/services/chat/trash_messages_spec.rb index 8961682ee85..e0491878429 100644 --- a/plugins/chat/spec/services/chat/trash_messages_spec.rb +++ b/plugins/chat/spec/services/chat/trash_messages_spec.rb @@ -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) } diff --git a/plugins/chat/spec/services/chat/update_channel_spec.rb b/plugins/chat/spec/services/chat/update_channel_spec.rb index 67f4d480974..1535d92ba26 100644 --- a/plugins/chat/spec/services/chat/update_channel_spec.rb +++ b/plugins/chat/spec/services/chat/update_channel_spec.rb @@ -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 diff --git a/plugins/poll/spec/requests/topics_controller_spec.rb b/plugins/poll/spec/requests/topics_controller_spec.rb index dba2a4d79ed..444e1759b65 100644 --- a/plugins/poll/spec/requests/topics_controller_spec.rb +++ b/plugins/poll/spec/requests/topics_controller_spec.rb @@ -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]") }