discourse/spec/models/topic_participant_groups_summary_spec.rb
Vinoth Kannan d4bfd441ba
FEATURE: display PM participant group names in the topics list. (#21677)
After this change, we can view all participant group names on the topic list page.

Co-authored-by: Régis Hanol <regis@hanol.fr>
2023-05-31 19:32:06 +05:30

18 lines
612 B
Ruby

# frozen_string_literal: true
RSpec.describe TopicParticipantGroupsSummary do
describe "#summary" do
fab!(:group1) { Fabricate(:group) }
fab!(:group2) { Fabricate(:group) }
fab!(:group3) { Fabricate(:group) }
let(:topic) { Fabricate(:private_message_topic) }
it "must contain the name of allowed groups" do
topic.allowed_group_ids = [group1.id, group2.id, group3.id]
expect(described_class.new(topic, group: group1).summary).to eq([group2.name, group3.name])
expect(described_class.new(topic, group: group2).summary).to eq([group1.name, group3.name])
end
end
end