Add integration test for module CSRF overrides

This commit is contained in:
lol768
2016-09-29 20:45:40 +01:00
parent 3930c5b34e
commit e066f896ef

View File

@@ -1965,4 +1965,21 @@ TEST_F(ZNCTest, KeepNickModule) {
":Unable to obtain nick user: Nope :-P, #error");
}
TEST_F(ZNCTest, ModuleCSRFOverride) {
auto znc = Run();
Z;
auto ircd = ConnectIRCd();
Z;
auto client = LoginClient();
Z;
client.Write("znc loadmod samplewebapi");
Z;
auto request = QNetworkRequest(QUrl("http://127.0.0.1:12345/mods/global/samplewebapi/"));
auto reply = HttpPost(request, {
{"text", "ipsum"}
})->readAll().toStdString();
Z;
EXPECT_THAT(reply, HasSubstr("ipsum"));
}
} // namespace