Remove obsolete loading animation
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / web / SoneTemplatePageTest.kt
index c16fdef..06d4c19 100644 (file)
@@ -24,7 +24,7 @@ import org.mockito.Mockito.verify
  */
 class SoneTemplatePageTest : WebPageTest() {
 
-       //      @get:JvmName("getPage1")
+       private val preferences by lazy { core.preferences!! }
        private val page = object : SoneTemplatePage("path.html", template, webInterface, true) {}
 
        @Test
@@ -33,18 +33,10 @@ class SoneTemplatePageTest : WebPageTest() {
        }
 
        @Test
-       fun `retrieving current sone with creation is forwarded to web interface`() {
-               mock<Sone>().let {
-                       whenever(webInterface.getCurrentSone(toadletContext, true)).thenReturn(it)
-                       assertThat(page.getCurrentSone(toadletContext, true), equalTo(it))
-               }
-       }
-
-       @Test
        fun `retrieving current sone without creation is forwarded to web interface`() {
                mock<Sone>().let {
-                       whenever(webInterface.getCurrentSone(toadletContext, false)).thenReturn(it)
-                       assertThat(page.getCurrentSone(toadletContext, false), equalTo(it))
+                       whenever(webInterface.getCurrentSoneWithoutCreatingSession(toadletContext)).thenReturn(it)
+                       assertThat(page.getCurrentSoneWithoutCreatingSession(toadletContext), equalTo(it))
                }
        }
 
@@ -115,8 +107,8 @@ class SoneTemplatePageTest : WebPageTest() {
        }
 
        @Test
-       fun `core is set in template context`() {
-               verifyVariableIsSet("core", core)
+       fun `preferences are set in template context`() {
+           verifyVariableIsSet("preferences", preferences)
        }
 
        @Test