✨ Use @TemplatePath annotations on most pages
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / web / pages / CreateReplyPageTest.kt
index 71e83bc..ec56267 100644 (file)
@@ -2,10 +2,14 @@ package net.pterodactylus.sone.web.pages
 
 import net.pterodactylus.sone.data.Post
 import net.pterodactylus.sone.data.Sone
+import net.pterodactylus.sone.test.getInstance
 import net.pterodactylus.sone.test.mock
+import net.pterodactylus.sone.web.baseInjector
+import net.pterodactylus.sone.web.page.*
 import net.pterodactylus.util.web.Method.POST
 import org.hamcrest.MatcherAssert.assertThat
 import org.hamcrest.Matchers.equalTo
+import org.hamcrest.Matchers.notNullValue
 import org.junit.Test
 import org.mockito.Mockito.verify
 
@@ -85,4 +89,14 @@ class CreateReplyPageTest: WebPageTest(::CreateReplyPage) {
                verifyRedirect("noPermission.html")
        }
 
+       @Test
+       fun `page can be created by dependency injection`() {
+           assertThat(baseInjector.getInstance<CreateReplyPage>(), notNullValue())
+       }
+
+       @Test
+       fun `page is annotated with correct template path`() {
+           assertThat(page.templatePath, equalTo("/templates/createReply.html"))
+       }
+
 }