=doc #18496 add scala docs for coding directives
This commit is contained in:
parent
92e2ac21f0
commit
073c201e75
7 changed files with 42 additions and 43 deletions
|
|
@ -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") }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue