diff options
Diffstat (limited to 'src/test/scala/xyz/driver/core/rest/DriverAppTest.scala')
-rw-r--r-- | src/test/scala/xyz/driver/core/rest/DriverAppTest.scala | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/test/scala/xyz/driver/core/rest/DriverAppTest.scala b/src/test/scala/xyz/driver/core/rest/DriverAppTest.scala index eda6a8c..8f552db 100644 --- a/src/test/scala/xyz/driver/core/rest/DriverAppTest.scala +++ b/src/test/scala/xyz/driver/core/rest/DriverAppTest.scala @@ -1,7 +1,8 @@ package xyz.driver.core.rest -import akka.http.scaladsl.model.{HttpMethod, StatusCodes} +import akka.http.scaladsl.model.headers.CacheDirectives.`no-cache` import akka.http.scaladsl.model.headers._ +import akka.http.scaladsl.model.{HttpMethod, StatusCodes} import akka.http.scaladsl.server.{Directives, Route} import akka.http.scaladsl.testkit.ScalatestRouteTest import com.typesafe.config.ConfigFactory @@ -81,4 +82,13 @@ class DriverAppTest extends AsyncFlatSpec with ScalatestRouteTest with Matchers header[`Access-Control-Allow-Methods`].get.methods should contain theSameElementsAs allowedMethods } } + + it should "respond with Pragma and Cache-Control (no-cache) headers" in { + val route = new TestApp(get(complete(StatusCodes.OK))) + Get(s"/api/v1/test") ~> route.appRoute ~> check { + status shouldBe StatusCodes.OK + header("Pragma").map(_.value()) should contain("no-cache") + header[`Cache-Control`].map(_.value()) should contain("no-cache") + } + } } |