# HG changeset patch # User Jaroslav Tulach # Date 1251638364 -7200 # Node ID 8358ef0d29d7416d18efe3cfb59a98262500de70 # Parent 1cce50d16bb5a5fb5609cc42f6f645021eac6512 Getting the page after login as well diff -r 1cce50d16bb5 -r 8358ef0d29d7 freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java --- a/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java Sun Aug 30 14:56:32 2009 +0200 +++ b/freemarkerdor/src/test/java/cz/xelfi/quoridor/freemarkerdor/UITest.java Sun Aug 30 15:19:24 2009 +0200 @@ -33,6 +33,7 @@ import java.io.IOException; import java.net.URI; import java.util.concurrent.Callable; +import javax.ws.rs.core.Cookie; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -97,6 +98,16 @@ if (res.indexOf("Quoridor") == -1) { fail("Wrong index.html:\n" + res); } + if (res.indexOf("Login") == -1) { + fail("Wrong index.html:\n" + res); + } + if (res.indexOf("action=\"login\"") == -1) { + fail("Wrong index.html:\n" + res); + } + res = webResource.cookie(Cookie.valueOf("login=jarda")).accept("text/html").get(String.class); + if (res.indexOf("action=\"games/create\"") == -1) { + fail(res); + } } }