dpon't emit Rules.RuleAdded notification upon rule editing.

This commit is contained in:
Michael Zanetti 2018-02-18 18:51:59 +01:00
parent 213db704a4
commit d5a1a03e5f
2 changed files with 4 additions and 1 deletions

View File

@ -750,7 +750,7 @@ RuleEngine::RuleError RuleEngine::editRule(const Rule &rule)
}
// The rule is removed, now add the new one
RuleError addResult = addRule(rule);
RuleError addResult = addRule(rule, true);
if (addResult != RuleErrorNoError) {
qCWarning(dcRuleEngine) << "Cannot edit rule. Could not add the new rule. Restoring the old rule.";
// restore old rule

View File

@ -876,6 +876,9 @@ void TestRules::editRules()
verifyRuleError(response, error);
if (error == RuleEngine::RuleErrorNoError){
clientSpy.wait(500);
// We need to get exactly 2 replies. The actual reply and the Changed notification
// Make sure there are no other notifications (e.g. RuleAdded or similar)
QCOMPARE(clientSpy.count(), 2);
QVariant notification = checkNotification(clientSpy, "Rules.RuleConfigurationChanged");
QVERIFY2(notification != QVariant(), "not received \"Rules.RuleConfigurationChanged\" notification");