A platform for community discussion. Free, open, simple.
DEV: Don’t provide an array to site settings group lists in specs
Loïc Guitaut93e02069b027
diff --git a/plugins/chat/spec/lib/chat/channel_fetcher_spec.rb b/plugins/chat/spec/lib/chat/channel_fetcher_spec.rbindex 021464c2b33..c509305a88f 100644--- a/plugins/chat/spec/lib/chat/channel_fetcher_spec.rb+++ b/plugins/chat/spec/lib/chat/channel_fetcher_spec.rb@@ -20,7 +20,7 @@ describe Chat::ChannelFetcher doChat::UserChatChannelMembership.where(user: user1)end- before { SiteSetting.chat_allowed_groups = [chatters] }+ before { SiteSetting.chat_allowed_groups = chatters }describe ".structured" doit "returns open channel only" dodiff --git a/plugins/chat/spec/lib/chat/guardian_extensions_spec.rb b/plugins/chat/spec/lib/chat/guardian_extensions_spec.rbindex 87ea025d789..881b43d8014 100644--- a/plugins/chat/spec/lib/chat/guardian_extensions_spec.rb+++ b/plugins/chat/spec/lib/chat/guardian_extensions_spec.rb@@ -10,7 +10,7 @@ RSpec.describe Chat::GuardianExtensions dolet(:guardian) { Guardian.new(user) }let(:staff_guardian) { Guardian.new(staff) }- before { SiteSetting.chat_allowed_groups = [chatters] }+ before { SiteSetting.chat_allowed_groups = chatters }describe "#can_chat?" docontext "when the user is not in allowed to chat" dodiff --git a/plugins/chat/spec/lib/chat/message_bookmarkable_spec.rb b/plugins/chat/spec/lib/chat/message_bookmarkable_spec.rbindex 98a866bf699..d75131c6da6 100644--- a/plugins/chat/spec/lib/chat/message_bookmarkable_spec.rb+++ b/plugins/chat/spec/lib/chat/message_bookmarkable_spec.rb@@ -14,7 +14,7 @@ describe Chat::MessageBookmarkable dobefore doregister_test_bookmarkable(described_class)Chat::UserChatChannelMembership.create(chat_channel: channel, user: user, following: true)- SiteSetting.chat_allowed_groups = [chatters]+ SiteSetting.chat_allowed_groups = chattersendafter { DiscoursePluginRegistry.reset_register!(:bookmarkables) }diff --git a/plugins/chat/spec/lib/chat_sdk/message_spec.rb b/plugins/chat/spec/lib/chat_sdk/message_spec.rbindex a9814c123f7..7eff710851e 100644--- a/plugins/chat/spec/lib/chat_sdk/message_spec.rb+++ b/plugins/chat/spec/lib/chat_sdk/message_spec.rb@@ -60,7 +60,7 @@ describe ChatSDK::Message docontext "when membership is enforced" doit "works" do- SiteSetting.chat_allowed_groups = [Group::AUTO_GROUPS[:everyone]]+ SiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]params[:enforce_membership] = trueparams[:guardian] = Fabricate(:user).guardian@@ -115,7 +115,7 @@ describe ChatSDK::Message dofab!(:message_1) { Fabricate(:chat_message, message: "first") }before do- SiteSetting.chat_allowed_groups = [Group::AUTO_GROUPS[:everyone]]+ SiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]message_1.chat_channel.add(message_1.user)message_1.update!(streaming: true)enddiff --git a/plugins/chat/spec/requests/chat/api/channels_messages_flags_controller_spec.rb b/plugins/chat/spec/requests/chat/api/channels_messages_flags_controller_spec.rbindex 43609d14f1d..5342ccc347e 100644--- a/plugins/chat/spec/requests/chat/api/channels_messages_flags_controller_spec.rb+++ b/plugins/chat/spec/requests/chat/api/channels_messages_flags_controller_spec.rb@@ -9,7 +9,7 @@ RSpec.describe Chat::Api::ChannelsMessagesFlagsController dobefore doSiteSetting.chat_enabled = trueSiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]- SiteSetting.chat_message_flag_allowed_groups = [Group::AUTO_GROUPS[:everyone]]+ SiteSetting.chat_message_flag_allowed_groups = Group::AUTO_GROUPS[:everyone]sign_in(current_user)enddiff --git a/plugins/chat/spec/requests/core_ext/bookmarks_controller_spec.rb b/plugins/chat/spec/requests/core_ext/bookmarks_controller_spec.rbindex c4d35355b31..1a4a0631ceb 100644--- a/plugins/chat/spec/requests/core_ext/bookmarks_controller_spec.rb+++ b/plugins/chat/spec/requests/core_ext/bookmarks_controller_spec.rb@@ -8,7 +8,7 @@ RSpec.describe BookmarksController dobefore doregister_test_bookmarkable(Chat::MessageBookmarkable)- SiteSetting.chat_allowed_groups = [chatters]+ SiteSetting.chat_allowed_groups = chatterssign_in(current_user)enddiff --git a/plugins/chat/spec/requests/core_ext/notifications_controller_spec.rb b/plugins/chat/spec/requests/core_ext/notifications_controller_spec.rbindex ecd9bfa1238..97442b9622f 100644--- a/plugins/chat/spec/requests/core_ext/notifications_controller_spec.rb+++ b/plugins/chat/spec/requests/core_ext/notifications_controller_spec.rb@@ -13,7 +13,7 @@ RSpec.describe NotificationsController dobefore doJobs.run_immediately!SiteSetting.chat_enabled = true- SiteSetting.chat_allowed_groups = [chatters.id]+ SiteSetting.chat_allowed_groups = chatters.idsign_in(user)enddiff --git a/plugins/chat/spec/requests/core_ext/users_controller_spec.rb b/plugins/chat/spec/requests/core_ext/users_controller_spec.rbindex 470f06104c0..693cfa875bc 100644--- a/plugins/chat/spec/requests/core_ext/users_controller_spec.rb+++ b/plugins/chat/spec/requests/core_ext/users_controller_spec.rb@@ -31,7 +31,7 @@ describe UsersController dobefore doregister_test_bookmarkable(Chat::MessageBookmarkable)- SiteSetting.chat_allowed_groups = [chatters]+ SiteSetting.chat_allowed_groups = chatterssign_in(current_user)enddiff --git a/plugins/chat/spec/services/auto_remove/handle_user_removed_from_group_spec.rb b/plugins/chat/spec/services/auto_remove/handle_user_removed_from_group_spec.rbindex 2c904bcf3d0..387d4a166d0 100644--- a/plugins/chat/spec/services/auto_remove/handle_user_removed_from_group_spec.rb+++ b/plugins/chat/spec/services/auto_remove/handle_user_removed_from_group_spec.rb@@ -143,7 +143,7 @@ RSpec.describe Chat::AutoRemove::HandleUserRemovedFromGroup dobefore dogroup_1.add(removed_user)group_2.add(removed_user)- SiteSetting.chat_allowed_groups = group_1.id.to_s + "|" + group_2.id.to_s+ SiteSetting.chat_allowed_groups = [group_1.id, group_2.id].join("|")CategoryGroup.create(category: private_category,group: group_2,diff --git a/plugins/chat/spec/services/chat/create_message_spec.rb b/plugins/chat/spec/services/chat/create_message_spec.rbindex 5ed68b2e221..3e7f666a962 100644--- a/plugins/chat/spec/services/chat/create_message_spec.rb+++ b/plugins/chat/spec/services/chat/create_message_spec.rb@@ -244,7 +244,7 @@ RSpec.describe Chat::CreateMessage dofab!(:user) { Fabricate(:user) }before do- SiteSetting.chat_allowed_groups = [Group::AUTO_GROUPS[:everyone]]+ SiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]params[:enforce_membership] = trueenddiff --git a/plugins/chat/spec/services/chat/invite_users_to_channel_spec.rb b/plugins/chat/spec/services/chat/invite_users_to_channel_spec.rbindex 0d0dafdcbae..6e9a8c7e03b 100644--- a/plugins/chat/spec/services/chat/invite_users_to_channel_spec.rb+++ b/plugins/chat/spec/services/chat/invite_users_to_channel_spec.rb@@ -25,7 +25,7 @@ RSpec.describe Chat::InviteUsersToChannel dobefore dogroup_1.add(user_1)- SiteSetting.chat_allowed_groups = [group_1].map(&:id).join("|")+ SiteSetting.chat_allowed_groups = group_1.idendcontext "when all steps pass" dodiff --git a/plugins/chat/spec/services/chat/stop_message_streaming_spec.rb b/plugins/chat/spec/services/chat/stop_message_streaming_spec.rbindex 2a006a88235..e4b6058907b 100644--- a/plugins/chat/spec/services/chat/stop_message_streaming_spec.rb+++ b/plugins/chat/spec/services/chat/stop_message_streaming_spec.rb@@ -13,7 +13,7 @@ RSpec.describe Chat::StopMessageStreaming dobefore dochannel_1.add(current_user)- SiteSetting.chat_allowed_groups = [Group::AUTO_GROUPS[:everyone]]+ SiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]endcontext "with valid params" dodiff --git a/plugins/chat/spec/services/chat/update_user_channel_last_read_spec.rb b/plugins/chat/spec/services/chat/update_user_channel_last_read_spec.rbindex 9122305685a..e3b045fc8c6 100644--- a/plugins/chat/spec/services/chat/update_user_channel_last_read_spec.rb+++ b/plugins/chat/spec/services/chat/update_user_channel_last_read_spec.rb@@ -20,7 +20,7 @@ RSpec.describe Chat::UpdateUserChannelLastRead dolet(:guardian) { Guardian.new(current_user) }let(:params) { { guardian: guardian, channel_id: channel.id, message_id: message_1.id } }- before { SiteSetting.chat_allowed_groups = [chatters] }+ before { SiteSetting.chat_allowed_groups = chatters }context "when params are not valid" dobefore { params.delete(:message_id) }diff --git a/plugins/chat/spec/services/chat/update_user_thread_last_read_spec.rb b/plugins/chat/spec/services/chat/update_user_thread_last_read_spec.rbindex 5802478dd60..f7251a16b04 100644--- a/plugins/chat/spec/services/chat/update_user_thread_last_read_spec.rb+++ b/plugins/chat/spec/services/chat/update_user_thread_last_read_spec.rb@@ -26,7 +26,7 @@ RSpec.describe Chat::UpdateUserThreadLastRead dobefore dothread.add(current_user)- SiteSetting.chat_allowed_groups = [chatters]+ SiteSetting.chat_allowed_groups = chattersendcontext "when params are not valid" do