import net.pterodactylus.sone.web.pages.WebPageTest
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.contains
+import org.hamcrest.Matchers.equalTo
import org.junit.Before
import org.junit.Test
}
@Test
+ fun `page returns correct path`() {
+ assertThat(page.path, equalTo("knownSones.html"))
+ }
+
+ @Test
+ fun `page does not require login`() {
+ assertThat(page.requiresLogin(), equalTo(false))
+ }
+
+ @Test
+ fun `page returns correct title`() {
+ whenever(l10n.getString("Page.KnownSones.Title")).thenReturn("known sones page title")
+ assertThat(page.getPageTitle(freenetRequest), equalTo("known sones page title"))
+ }
+
+ @Test
fun `default known sones are sorted newest first`() {
page.handleRequest(freenetRequest, templateContext)
verifySonesAreInOrder(3, 2, 1, 0)