0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/plugins/discourse-policy/spec/reports/unaccepted_policies_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

30 lines
648 B
Ruby
Vendored

# frozen_string_literal: true
RSpec.describe Report do
fab!(:user1, :user)
fab!(:user2, :user)
fab!(:group1) do
group = Fabricate(:group)
group.add(user1)
group.add(user2)
group
end
fab!(:policy) do
policy = Fabricate(:post_policy)
PostPolicyGroup.create!(post_policy_id: policy.id, group_id: group1.id)
policy
end
before do
enable_current_plugin
PolicyUser.add!(user1, policy)
end
it "reports users who have not accepted" do
report = Report.find("unaccepted-policies")
topic = policy.post.topic
expect(report.data).to eq([{ topic_id: topic.id, user_id: user2.id }])
end
end