import net.pterodactylus.sone.test.mock
import net.pterodactylus.sone.test.mockBuilder
import net.pterodactylus.sone.test.whenever
-import net.pterodactylus.sone.web.pages.EditImagePage
-import net.pterodactylus.sone.web.pages.WebPageTest
import net.pterodactylus.util.web.Method.GET
import net.pterodactylus.util.web.Method.POST
+import org.hamcrest.MatcherAssert.assertThat
+import org.hamcrest.Matchers.equalTo
import org.junit.Before
import org.junit.Test
import org.mockito.Mockito.never
}
@Test
+ fun `page returns correct path`() {
+ assertThat(page.path, equalTo("editImage.html"))
+ }
+
+ @Test
+ fun `page requires login`() {
+ assertThat(page.requiresLogin(), equalTo(true))
+ }
+
+ @Test
+ fun `page returns correct title`() {
+ whenever(l10n.getString("Page.EditImage.Title")).thenReturn("edit image page title")
+ assertThat(page.getPageTitle(freenetRequest), equalTo("edit image page title"))
+ }
+
+ @Test
fun `get request does not redirect`() {
request("", GET)
page.handleRequest(freenetRequest, templateContext)