Add test for not cancelling on HTML MIME type
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 23 Apr 2017 14:11:34 +0000 (16:11 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 23 Apr 2017 14:11:34 +0000 (16:11 +0200)
src/test/kotlin/net/pterodactylus/sone/core/DefaultElementLoaderTest.kt

index 40d0054..d31900d 100644 (file)
@@ -92,6 +92,13 @@ class DefaultElementLoaderTest {
        }
 
        @Test
+       fun `element loader does not cancel on text html mime type`() {
+               elementLoader.loadElement(IMAGE_ID)
+               verify(freenetInterface).startFetch(eq(freenetURI), callback.capture())
+               assertThat(callback.value.shouldCancel(freenetURI, "text/html", sizeOkay), `is`(false))
+       }
+
+       @Test
        fun `image loader can load image`() {
                elementLoader.loadElement(decomposedKey)
                verify(freenetInterface).startFetch(eq(FreenetURI(decomposedKey)), callback.capture())