discourse/plugins/discourse-ai/spec/serializers/ai_chat_channel_serializer_spec.rb
Jarek Radosz 71834c898f
DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-10-06 16:11:01 +02:00

29 lines
756 B
Ruby
Vendored

# frozen_string_literal: true
RSpec.describe AiChatChannelSerializer do
fab!(:admin)
before { enable_current_plugin }
describe "#title" do
context "when the channel is a DM" do
fab!(:dm_channel, :direct_message_channel)
it "display every participant" do
serialized = described_class.new(dm_channel, scope: Guardian.new(admin), root: nil)
expect(serialized.title).to eq(dm_channel.title(nil))
end
end
context "when the channel is a regular one" do
fab!(:channel, :chat_channel)
it "displays the category title" do
serialized = described_class.new(channel, scope: Guardian.new(admin), root: nil)
expect(serialized.title).to eq(channel.title)
end
end
end
end