Avoid hard-coding exact error message in tests
We don't actually care about the exact error message here and if it changes tests would needlessly fail.
This commit is contained in:
parent
76b406f4e1
commit
299142bd1c
|
@ -676,7 +676,7 @@ void ConnectionTests::testRequestingRescan()
|
||||||
bool errorOccured = false;
|
bool errorOccured = false;
|
||||||
const auto errorHandler = [&errorOccured](const QString &message) {
|
const auto errorHandler = [&errorOccured](const QString &message) {
|
||||||
errorOccured |= message.startsWith(QStringLiteral("Unable to request rescan: Error transferring"))
|
errorOccured |= message.startsWith(QStringLiteral("Unable to request rescan: Error transferring"))
|
||||||
&& message.endsWith(QStringLiteral("/rest/db/scan?folder=non-existing-dir&sub=sub%2Fpath - server replied: Internal Server Error"));
|
&& message.contains(QStringLiteral("/rest/db/scan?folder=non-existing-dir&sub=sub%2Fpath - server replied: "));
|
||||||
};
|
};
|
||||||
waitForSignals(bind(&SyncthingConnection::rescan, &m_connection, QStringLiteral("non-existing-dir"), QStringLiteral("sub/path")), 5000,
|
waitForSignals(bind(&SyncthingConnection::rescan, &m_connection, QStringLiteral("non-existing-dir"), QStringLiteral("sub/path")), 5000,
|
||||||
connectionSignal(&SyncthingConnection::error, errorHandler, &errorOccured));
|
connectionSignal(&SyncthingConnection::error, errorHandler, &errorOccured));
|
||||||
|
|
Loading…
Reference in New Issue