summaryrefslogtreecommitdiffstats
path: root/tests/testqPrefFacebook.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testqPrefFacebook.cpp')
-rw-r--r--tests/testqPrefFacebook.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/testqPrefFacebook.cpp b/tests/testqPrefFacebook.cpp
index ebb2e4f02..59063b7a3 100644
--- a/tests/testqPrefFacebook.cpp
+++ b/tests/testqPrefFacebook.cpp
@@ -6,6 +6,7 @@
#include "core/qthelper.h"
#include <QTest>
+#include <QSignalSpy>
void TestQPrefFacebook::initTestCase()
{
@@ -86,4 +87,23 @@ void TestQPrefFacebook::test_oldPreferences()
TEST(fb->album_id(), QStringLiteral("album-id-2"));
}
+void TestQPrefFacebook::test_signals()
+{
+ QSignalSpy spy1(qPrefFacebook::instance(), SIGNAL(access_tokenChanged(QString)));
+ QSignalSpy spy2(qPrefFacebook::instance(), SIGNAL(album_idChanged(QString)));
+ QSignalSpy spy3(qPrefFacebook::instance(), SIGNAL(user_idChanged(QString)));
+
+ qPrefFacebook::set_access_token("t_signal token");
+ qPrefFacebook::set_album_id("t_signal album");
+ qPrefFacebook::set_user_id("t_signal user");
+
+ QCOMPARE(spy1.count(), 1);
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(spy3.count(), 1);
+ QVERIFY(spy1.takeFirst().at(0).toString() == "t_signal token");
+ QVERIFY(spy2.takeFirst().at(0).toString() == "t_signal album");
+ QVERIFY(spy3.takeFirst().at(0).toString() == "t_signal user");
+}
+
+
QTEST_MAIN(TestQPrefFacebook)