]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/LoginTest.java
add: test case to verify that the login method is displayed correctly
[gigi.git] / 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"));
+    }
+
 }