X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FSearchPageTest.kt;h=dc62031872d00a9a5448c23663a813a392dcb292;hp=00fa5cfde16b8fd5a3f95b46a1f7d36765e979c8;hb=110a933c2724aba6a604fc5eed6372ff1e1e6144;hpb=fc8e9ea5c978d2f5a00894e093364ae62f18934b diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/SearchPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/SearchPageTest.kt index 00fa5cf..dc62031 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/SearchPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/SearchPageTest.kt @@ -14,6 +14,7 @@ import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.utils.asOptional import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.contains import org.hamcrest.Matchers.equalTo @@ -25,7 +26,7 @@ import java.util.concurrent.atomic.AtomicInteger /** * Unit test for [SearchPage]. */ -class SearchPageTest: WebPageTest({ template, webInterface -> SearchPage(template, webInterface, ticker) }) { +class SearchPageTest: WebPageTest({ webInterface, loaders, templateRenderer -> SearchPage(webInterface, loaders, templateRenderer, ticker) }) { companion object { val ticker = mock() @@ -44,7 +45,7 @@ class SearchPageTest: WebPageTest({ template, webInterface -> SearchPage(templat @Test fun `page returns correct title`() { addTranslation("Page.Search.Title", "search page title") - assertThat(page.getPageTitle(freenetRequest), equalTo("search page title")) + assertThat(page.getPageTitle(soneRequest), equalTo("search page title")) } @Test @@ -372,4 +373,9 @@ class SearchPageTest: WebPageTest({ template, webInterface -> SearchPage(templat assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct template path`() { + assertThat(page.templatePath, equalTo("/templates/search.html")) + } + }