The Play framework allows us to test routes as well. This is good, because as our application grows and we refactor the code, we can be 100% sure that our routes are functioning. Route testing could be easily confused with controller testing. The main difference is that, with routing testing, we should test if we are able to reach the routes and that's it. After route testing, we will cover controller testing in detail.
Your RoutesTestingSpec.scala
file should contain the following code:
class RoutesTestingSpec extends PlaySpec with OneAppPerTest { "Root Controller" should { "route to index page" in { val result = route(app, FakeRequest(GET, "/")).get status(result) mustBe OK contentType(result) mustBe Some("text/html") contentAsString(result) must include ("Welcome to Reactive Web Store") } ...