import net.pterodactylus.sone.data.Sone
import net.pterodactylus.sone.test.mock
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.any
import org.mockito.ArgumentMatchers.eq
override fun getPage() = page
@Test
+ fun `page returns correct path`() {
+ assertThat(page.path, equalTo("untrust.html"))
+ }
+
+ @Test
+ fun `page requires login`() {
+ assertThat(page.requiresLogin(), equalTo(true))
+ }
+
+ @Test
+ fun `page returns correct title`() {
+ addTranslation("Page.Untrust.Title", "untrust page title")
+ assertThat(page.getPageTitle(freenetRequest), equalTo("untrust page title"))
+ }
+
+ @Test
fun `get request does not redirect`() {
verifyNoRedirect {
verify(core, never()).untrustSone(eq(currentSone), any())