]> WPIA git - gigi.git/commitdiff
add: test case to verify that the login method is displayed correctly
authorFelix Dörre <felix@dogcraft.de>
Tue, 31 May 2016 22:19:56 +0000 (00:19 +0200)
committerFelix Dörre <felix@dogcraft.de>
Tue, 31 May 2016 22:38:56 +0000 (00:38 +0200)
Change-Id: Ie5b09321ac65dc0ab065731327a723f307f0e88f

tests/org/cacert/gigi/LoginTest.java

index 29456c7b2a24a8d20b3580ea0801ec91ae330c79..cb575caf78190d3fb97bf33e0326beb242af57b6 100644 (file)
@@ -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"));
+    }
+
 }