]> WPIA git - gigi.git/blobdiff - tests/club/wpia/gigi/pages/account/TestTrainings.java
upd: rename package name and all references to it
[gigi.git] / tests / club / wpia / gigi / pages / account / TestTrainings.java
diff --git a/tests/club/wpia/gigi/pages/account/TestTrainings.java b/tests/club/wpia/gigi/pages/account/TestTrainings.java
new file mode 100644 (file)
index 0000000..1c55957
--- /dev/null
@@ -0,0 +1,34 @@
+package club.wpia.gigi.pages.account;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.*;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.sql.Date;
+
+import org.junit.Test;
+
+import club.wpia.gigi.dbObjects.CATS;
+import club.wpia.gigi.dbObjects.CATS.CATSType;
+import club.wpia.gigi.pages.account.UserTrainings;
+import club.wpia.gigi.testUtils.ClientTest;
+import club.wpia.gigi.testUtils.IOUtils;
+import club.wpia.gigi.util.HTMLEncoder;
+
+public class TestTrainings extends ClientTest {
+
+    public TestTrainings() throws GeneralSecurityException, IOException {}
+
+    @Test
+    public void testShow() throws IOException, GeneralSecurityException {
+        CATS.enterResult(u, CATSType.ASSURER_CHALLENGE, new Date(System.currentTimeMillis()), "en_US", "1");
+        CATS.enterResult(u, "Special Case Test", new Date(System.currentTimeMillis()), "spLan", "v23");
+        String res = IOUtils.readURL(get(UserTrainings.PATH));
+        assertThat(res, containsString("Special Case Test"));
+        assertThat(res, containsString(HTMLEncoder.encodeHTML(CATSType.ASSURER_CHALLENGE.getDisplayName())));
+        assertThat(res, containsString("en_US, 1"));
+        assertThat(res, containsString("v23"));
+        assertThat(res, containsString("spLan"));
+    }
+}