+ @Test
+ fun `index page without posts sets correct pagination`() {
+ core.preferences.newPostsPerPage = 1
+ page.processTemplate(freenetRequest, templateContext)
+ @Suppress("UNCHECKED_CAST")
+ (templateContext["pagination"] as Pagination<Post>).let { pagination ->
+ assertThat(pagination.items, emptyIterable())
+ }
+ }
+
+ @Test
+ fun `page can be created by dependency injection`() {
+ assertThat(baseInjector.getInstance<IndexPage>(), notNullValue())
+ }
+
+ @Test
+ fun `page is annotated with correct menuname`() {
+ assertThat(page.menuName, equalTo("Index"))
+ }
+
+ @Test
+ fun `page is annotated with correct template path`() {
+ assertThat(page.templatePath, equalTo("/templates/index.html"))
+ }
+