File indexing completed on 2024-06-02 05:07:04
0001 /* 0002 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "userspresencejobtest.h" 0008 #include "restapimethod.h" 0009 #include "ruqola_restapi_helper.h" 0010 #include "users/userspresencejob.h" 0011 QTEST_GUILESS_MAIN(UsersPresenceJobTest) 0012 using namespace RocketChatRestApi; 0013 UsersPresenceJobTest::UsersPresenceJobTest(QObject *parent) 0014 : QObject(parent) 0015 { 0016 } 0017 0018 void UsersPresenceJobTest::shouldHaveDefaultValue() 0019 { 0020 UsersPresenceJob job; 0021 verifyDefaultValue(&job); 0022 QVERIFY(job.requireHttpAuthentication()); 0023 QVERIFY(!job.hasQueryParameterSupport()); 0024 } 0025 0026 void UsersPresenceJobTest::shouldGenerateRequest() 0027 { 0028 UsersPresenceJob job; 0029 QNetworkRequest request = QNetworkRequest(QUrl()); 0030 verifyAuthentication(&job, request); 0031 QCOMPARE(request.url(), QUrl(QStringLiteral("http://www.kde.org/api/v1/users.presence"))); 0032 } 0033 0034 #include "moc_userspresencejobtest.cpp"