From 18ca4013b27f49c023cade364c46e5f2ef77b65d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Wed, 1 Jun 2016 00:19:56 +0200 Subject: [PATCH] add: test case to verify that the login method is displayed correctly Change-Id: Ie5b09321ac65dc0ab065731327a723f307f0e88f --- tests/org/cacert/gigi/LoginTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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")); + } + } -- 2.39.2