=doc #18496 add scala docs for coding directives

This commit is contained in:
Martynas Mickevicius 2015-10-14 16:33:51 +02:00
parent 92e2ac21f0
commit 073c201e75
7 changed files with 42 additions and 43 deletions

View file

@ -14,6 +14,16 @@ import akka.util.ByteString
import org.scalatest.matchers.Matcher
class CodingDirectivesExamplesSpec extends RoutingSpec {
"responseEncodingAccepted" in {
val route = responseEncodingAccepted(gzip) { complete("content") }
Get("/") ~> route ~> check {
responseAs[String] shouldEqual "content"
}
Get("/") ~> `Accept-Encoding`(`identity;q=MIN`) ~> route ~> check {
rejection shouldEqual UnacceptedResponseEncodingRejection(gzip)
}
}
"encodeResponse" in {
val route = encodeResponse { complete("content") }