Skip to content
Snippets Groups Projects
Verified Commit 1f42cb0c authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Add a test for policy rules

parent ddf7e4f1
No related branches found
No related tags found
No related merge requests found
Pipeline #3371 passed
......@@ -838,6 +838,23 @@ TEST(StateEvents, PolicyRuleUser)
EXPECT_EQ(event.content.entity, "@alice*:example.org");
EXPECT_EQ(event.content.reason, "undesirable behaviour");
EXPECT_EQ(event.content.recommendation, ns::state::policy_rule::recommendation::ban);
data = R"(
{
"content": null,
"event_id": "$143273582443PhrSn:example.org",
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"sender": "@example:example.org",
"state_key": "rule:@alice*:example.org",
"type": "m.policy.rule.user",
"unsigned": {
"age": 1234
}
}
)"_json;
event = data.get<ns::StateEvent<ns::state::policy_rule::UserRule>>();
EXPECT_EQ(event.type, ns::EventType::PolicyRuleUser);
}
TEST(StateEvents, PolicyRuleRoom)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment