import net.pterodactylus.sone.data.PostReply
import net.pterodactylus.sone.data.Sone
import net.pterodactylus.sone.test.mock
-import net.pterodactylus.sone.web.pages.MarkAsKnownPage
-import net.pterodactylus.sone.web.pages.WebPageTest
+import org.hamcrest.MatcherAssert.assertThat
+import org.hamcrest.Matchers.equalTo
import org.junit.Test
import org.mockito.Mockito.verify
/**
* Unit test for [MarkAsKnownPage].
*/
-class MarkAsKnownPageTest : WebPageTest() {
+class MarkAsKnownPageTest: WebPageTest() {
private val page = MarkAsKnownPage(template, webInterface)
override fun getPage() = page
@Test
+ fun `page returns correct path`() {
+ assertThat(page.path, equalTo("markAsKnown.html"))
+ }
+
+ @Test
+ fun `page does not require login`() {
+ assertThat(page.requiresLogin(), equalTo(false))
+ }
+
+ @Test
+ fun `page returns correct title`() {
+ addTranslation("Page.MarkAsKnown.Title", "mark as known page title")
+ assertThat(page.getPageTitle(freenetRequest), equalTo("mark as known page title"))
+ }
+
+ @Test
fun `posts can be marked as known`() {
addHttpRequestPart("returnPage", "return.html")
addHttpRequestPart("type", "post")