From: Felix Dörre Date: Tue, 31 May 2016 22:19:56 +0000 (+0200) Subject: add: test case to verify that the login method is displayed correctly X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=18ca4013b27f49c023cade364c46e5f2ef77b65d add: test case to verify that the login method is displayed correctly Change-Id: Ie5b09321ac65dc0ab065731327a723f307f0e88f --- diff --git a/tests/org/cacert/gigi/LoginTest.java b/tests/org/cacert/gigi/LoginTest.java index 29456c7b..cb575caf 100644 --- a/tests/org/cacert/gigi/LoginTest.java +++ b/tests/org/cacert/gigi/LoginTest.java @@ -1,9 +1,12 @@ package org.cacert.gigi; +import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import java.io.IOException; +import java.net.URLConnection; +import org.cacert.gigi.testUtils.IOUtils; import org.cacert.gigi.testUtils.ManagedTest; import org.junit.Test; @@ -45,4 +48,14 @@ public class LoginTest extends ManagedTest { get(cookie, "/logout").getHeaderField("Location"); } + @Test + public void testLoginMethodDisplay() throws IOException { + String email = createUniqueName() + "@testmail.org"; + createVerifiedUser("an", "bn", email, TEST_PASSWORD); + String l = login(email, TEST_PASSWORD); + URLConnection c = get(l, ""); + String readURL = IOUtils.readURL(c); + assertThat(readURL, containsString("Password")); + } + }