Alex,
you have to decide whether you want to test your route *including* the rejection handler or *excluding* the rejection handler.
You cannot do both at once.
This is also apparent when you look at the types:
type Route = RequestContext ⇒ Future[RouteResult]
sealed trait RouteResult
object RouteResult {
final case class Complete(response: HttpResponse) extends RouteResult
final case class Rejected(rejections: immutable.Seq[Rejection]) extends RouteResult
}
So, either you test for the presence of a rejection or your test for the presence of a certain response.
It looks like your test is of the form *excluding* the rejection handler.
Like in spray you need to “seal” your route if you want to test the rejection handling as well.
In Akka HTTP you do that by wrapping your route with `Route.seal(…)`.
HTH and cheers,
Mathias
---
mat...@spray.io
http://spray.io
> --
> You received this message because you are subscribed to the Google Groups "
spray.io User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
spray-user+...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/spray-user.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/spray-user/c1fc7d24-8f45-4a6d-b20b-30483292bf8e%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.