There are several directions we could take when testing our routes (no pun intended ).
For our purpose, we will define some use cases and then develop some more helper code, which will allow us to fire up our routes and do real HTTP requests and check the database and the responses.
Testing our routes
Testing our routes
An actor for starting our routes
We build upon our BaseSpec class and call it BaseUseCaseSpec. In it, we will do some more things, such as define a global base URL that can be used from the tests to make correct requests. Additionally, we will write a small actor, which simply starts an Akka-HTTP server.