From 6b52ee7437622973f2823cfaca664bf82dec3f37 Mon Sep 17 00:00:00 2001 From: Jan Cernik Date: Wed, 8 Feb 2023 00:12:20 -0300 Subject: [PATCH] Make user only have read-only permission --- plugins/chat/spec/system/visit_channel_spec.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/chat/spec/system/visit_channel_spec.rb b/plugins/chat/spec/system/visit_channel_spec.rb index 1c823e912d..de4fb71c1e 100644 --- a/plugins/chat/spec/system/visit_channel_spec.rb +++ b/plugins/chat/spec/system/visit_channel_spec.rb @@ -94,17 +94,14 @@ RSpec.describe "Visit channel", type: :system, js: true do end context "when category channel is read-only" do - fab!(:readonly_category_1) { Fabricate(:private_category, group: Fabricate(:group)) } fab!(:readonly_group_1) { Fabricate(:group, users: [current_user]) } - fab!(:readonly_category_channel_1) do - Fabricate(:private_category_channel, group: readonly_group_1) - end + fab!(:readonly_category_channel_1) { Fabricate(:category_channel, chatable: category) } fab!(:message_1) { Fabricate(:chat_message, chat_channel: readonly_category_channel_1) } before do Fabricate( :category_group, - category: readonly_category_1, + category: category, group: readonly_group_1, permission_type: CategoryGroup.permission_types[:readonly], )