feature #6: start to implement path for article

This commit is contained in:
2019-07-25 16:57:53 +02:00
parent ea4b05ebb3
commit 0d2c46538f
5 changed files with 47 additions and 54 deletions

View File

@@ -1,24 +1,19 @@
package fr.dcproject
import io.ktor.application.*
import io.ktor.response.*
import io.ktor.request.*
import io.ktor.routing.*
import io.ktor.http.*
import io.ktor.locations.*
import io.ktor.auth.*
import io.ktor.gson.*
import io.ktor.features.*
import kotlin.test.*
import io.ktor.server.testing.*
import io.ktor.http.HttpMethod
import io.ktor.http.HttpStatusCode
import io.ktor.server.testing.handleRequest
import io.ktor.server.testing.withTestApplication
import kotlin.test.Test
import kotlin.test.assertEquals
class ApplicationTest {
@Test
fun testRoot() {
withTestApplication({ module(testing = true) }) {
handleRequest(HttpMethod.Get, "/").apply {
handleRequest(HttpMethod.Get, "/articles").apply {
assertEquals(HttpStatusCode.OK, response.status())
assertEquals("HELLO WORLD!", response.content)
assertEquals("todo", response.content)
}
}
}