From: David ‘Bombe’ Roden Date: Wed, 24 May 2017 17:39:38 +0000 (+0200) Subject: Add more tests for new page X-Git-Tag: 0.9.7^2~203 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4931e11b371842eea6fdf9bea7504eed63ea298c;p=Sone.git Add more tests for new page --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt index 72d87f8..62b1baa 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt @@ -7,6 +7,7 @@ import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.whenever import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.containsInAnyOrder +import org.hamcrest.Matchers.equalTo import org.junit.Before import org.junit.Test import java.util.Arrays.asList @@ -26,6 +27,22 @@ class NewPageTest: WebPageTest() { } @Test + fun `page returns correct path`() { + assertThat(page.path, equalTo("new.html")) + } + + @Test + fun `page does not require login`() { + assertThat(page.requiresLogin(), equalTo(false)) + } + + @Test + fun `page returns correct title`() { + addTranslation("Page.New.Title", "new page title") + assertThat(page.getPageTitle(freenetRequest), equalTo("new page title")) + } + + @Test fun `posts are not duplicated when they come from both new posts and new replies notifications`() { val extraPost = mock() val posts = asList(mock(), mock())