mirror of
https://github.com/discourse/discourse.git
synced 2024-12-19 18:44:10 +08:00
18 lines
612 B
Ruby
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
|