Ensuring the Application Works for Real

There’s one last thing to try before we call it a day. Your specs provide evidence that the application works, but they certainly don’t provide proof. Let’s try running the app by hand (as we did at the end of Saving Your Progress: Pending Specs) to see for ourselves whether or not it really works. First, boot up the app using the rackup command:

 $ ​​bundle​​ ​​exec​​ ​​rackup
 [2017-06-13 13:34:47] INFO WEBrick 1.3.1
 [2017-06-13 13:34:47] INFO ruby 2.4.1 (2017-03-22) [x86_64-darwin15]
 [2017-06-13 13:34:47] INFO WEBrick::HTTPServer​#start: pid=45899 port=9292

With your API server running, try hitting the application’s HTTP endpoint from another terminal:

 $ ​​curl localhost:9292/expenses/2017-06-10 ...

Get Effective Testing with RSpec 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.