✅ Add test for saving insertion delay
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 29 Nov 2019 17:07:41 +0000 (18:07 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 29 Nov 2019 17:34:23 +0000 (18:34 +0100)
src/test/kotlin/net/pterodactylus/sone/core/PreferencesTest.kt

index 6da6658..245ff03 100644 (file)
@@ -6,6 +6,7 @@ import net.pterodactylus.sone.fcp.FcpInterface.*
 import net.pterodactylus.sone.fcp.FcpInterface.FullAccessRequired.*
 import net.pterodactylus.sone.fcp.event.*
 import net.pterodactylus.sone.test.*
+import net.pterodactylus.util.config.*
 import org.hamcrest.MatcherAssert.*
 import org.hamcrest.Matchers.*
 import org.junit.*
@@ -64,6 +65,13 @@ class PreferencesTest {
        }
 
        @Test
+       fun `preferences saves null for default insertion delay setting`() {
+               val configuration = Configuration(MapConfigurationBackend())
+               preferences.saveTo(configuration)
+               assertThat(configuration.getIntValue("Option/InsertionDelay").getValue(null), nullValue())
+       }
+
+       @Test
        fun `preferences retain posts per page`() {
                preferences.newPostsPerPage = 15
                assertThat(preferences.postsPerPage, equalTo(15))