O'Reilly logo

RSpec Essentials by Mani Tadayon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Step 2 – defining the API

We're going to add some backend code in Ruby so that we have an API server for our view to connect to. This will allow us to save our todo list between browser sessions. It will also lay the foundation for many new features that we might want to add in the real world, such as sharing lists with other people, user management, and sending e-mail reminders about unfinished todos.

So where do we start with our backend code? With BDD, we keep going from the outside in. We'll just make a small change to our AngularJS service to rely on an HTTP API. That will give us a list of endpoints that our API server needs to handle and a good starting place for our work on the backend. This is one of the benefits of BDD. It points the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required