dpon't emit Rules.RuleAdded notification upon rule editing.
This commit is contained in:
parent
213db704a4
commit
d5a1a03e5f
@ -750,7 +750,7 @@ RuleEngine::RuleError RuleEngine::editRule(const Rule &rule)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The rule is removed, now add the new one
|
// The rule is removed, now add the new one
|
||||||
RuleError addResult = addRule(rule);
|
RuleError addResult = addRule(rule, true);
|
||||||
if (addResult != RuleErrorNoError) {
|
if (addResult != RuleErrorNoError) {
|
||||||
qCWarning(dcRuleEngine) << "Cannot edit rule. Could not add the new rule. Restoring the old rule.";
|
qCWarning(dcRuleEngine) << "Cannot edit rule. Could not add the new rule. Restoring the old rule.";
|
||||||
// restore old rule
|
// restore old rule
|
||||||
|
|||||||
@ -876,6 +876,9 @@ void TestRules::editRules()
|
|||||||
verifyRuleError(response, error);
|
verifyRuleError(response, error);
|
||||||
if (error == RuleEngine::RuleErrorNoError){
|
if (error == RuleEngine::RuleErrorNoError){
|
||||||
clientSpy.wait(500);
|
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");
|
QVariant notification = checkNotification(clientSpy, "Rules.RuleConfigurationChanged");
|
||||||
QVERIFY2(notification != QVariant(), "not received \"Rules.RuleConfigurationChanged\" notification");
|
QVERIFY2(notification != QVariant(), "not received \"Rules.RuleConfigurationChanged\" notification");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user