import net.pterodactylus.sone.test.whenever
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.verify
/**
* Unit test for [EditAlbumPage].
*/
-class EditAlbumPageTest : WebPageTest() {
+class EditAlbumPageTest: WebPageTest() {
private val page = EditAlbumPage(template, webInterface)
}
@Test
+ fun `page returns correct path`() {
+ assertThat(page.path, equalTo("editAlbum.html"))
+ }
+
+ @Test
+ fun `page requires login`() {
+ assertThat(page.requiresLogin(), equalTo(true))
+ }
+
+ @Test
+ fun `page returns correct title`() {
+ whenever(l10n.getString("Page.EditAlbum.Title")).thenReturn("edit album page")
+ assertThat(page.getPageTitle(freenetRequest), equalTo("edit album page"))
+ }
+
+ @Test
fun `get request does not redirect`() {
request("", GET)
page.handleRequest(freenetRequest, templateContext)