import net.pterodactylus.sone.data.Sone
import net.pterodactylus.sone.test.mock
-import net.pterodactylus.sone.web.pages.FollowSonePage
-import net.pterodactylus.sone.web.pages.WebPageTest
+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.Test
import org.mockito.ArgumentMatchers
import org.mockito.ArgumentMatchers.any
override fun getPage() = page
@Test
+ fun `page returns correct path`() {
+ assertThat(page.path, equalTo("followSone.html"))
+ }
+
+ @Test
+ fun `page requires login`() {
+ assertThat(page.requiresLogin(), equalTo(true))
+ }
+
+ @Test
+ fun `page returns correct title`() {
+ whenever(l10n.getString("Page.FollowSone.Title")).thenReturn("follow sone page title")
+ assertThat(page.getPageTitle(freenetRequest), equalTo("follow sone page title"))
+ }
+
+ @Test
fun `get request does not redirect`() {
request("", GET)
page.handleRequest(freenetRequest, templateContext)