🔥 Remove templates from FreenetTemplatePages
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / web / pages / DeleteProfileFieldPageTest.kt
index 862fff4..678991d 100644 (file)
@@ -1,10 +1,14 @@
 package net.pterodactylus.sone.web.pages
 
 import net.pterodactylus.sone.data.Profile
+import net.pterodactylus.sone.test.getInstance
 import net.pterodactylus.sone.test.whenever
+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.hamcrest.Matchers.nullValue
 import org.junit.Before
 import org.junit.Test
@@ -15,7 +19,7 @@ import org.mockito.Mockito.verify
 /**
  * Unit test for [DeleteProfileFieldPage].
  */
-class DeleteProfileFieldPageTest: WebPageTest2(::DeleteProfileFieldPage) {
+class DeleteProfileFieldPageTest: WebPageTest(::DeleteProfileFieldPage) {
 
        private val profile = Profile(currentSone)
        private val field = profile.addField("name")
@@ -75,4 +79,14 @@ class DeleteProfileFieldPageTest: WebPageTest2(::DeleteProfileFieldPage) {
                }
        }
 
+       @Test
+       fun `page can be created by dependency injection`() {
+               assertThat(baseInjector.getInstance<DeleteProfileFieldPage>(), notNullValue())
+       }
+
+       @Test
+       fun `page is annotated with correct template path`() {
+           assertThat(page.templatePath, equalTo("/templates/deleteProfileField.html"))
+       }
+
 }