Testing the application: object interactions and AJAX calls
The final step in the series of posts about adding tests for the Backbone application is to add tests for functions that interact with other objects as well as dealing with those pesky AJAX calls. This addresses the “spies and mocks will be addressed later” can that has been kicked down the rode so far […]
In addition to the model and view tests, tests for the workflow of the Backbone application need to be added. As before, see the full repository for more context around the tests. The test shell As with the previous tests, the specification for the workflow needs to pull in a reference to the workflow module. […]
As part of the series of posts, the next three posts are dedicated towards writing tests for the Backbone application created in the previous post. All of the tests (in more detail than outlined below) are available. Adding the page to run the tests As with the tests for the API layer, the application tests […]
Now that the API exists, it is time to create the Backbone application. The full code for the application is available. More so than in the previous steps in the series, there is a lot more content in the application than is shown below. Looking through the full source provides a much more complete context […]
Hosting the Node API in nginx with a reverse proxy
The Backbone application (coming in the next post in the series) will interact with the REST API using AJAX calls. Adding a reverse proxy allows those calls to work without browsers stopping the requests due to cross-site scripting (XSS) concerns and without setting up cross-origin resource sharing (CORS). Using nginx Nginx is used to setup […]
The API created in the previous step did not have any tests. It is now time to start to rectify that. As before, in addition to the example code below, the full code for the tests is available. Adding Jasmine specifications The tests are written in Jasmine, a behavior-driven development testing framework. The tests are written as […]
The first step in creating the example application is to create an API for the application to interact with. Node, Express, and Mongoose are used to create a REST API. In addition to the example code below, the full code for the API is available. Environment setup To support the API, Node and MongoDB need […]
A non-typical Backbone example When you start looking into Backbone, you may notice that many of the readily available example sites are setup in the same pattern: display a list of things with a list view and a details. This kind of of example plays to the strengths of the Backbone API. It has some […]
We have made available a new tool, Crucible Hook, to allow GitLab to notify Crucible about new commits. Rather than having external services (Crucible, Jenkins, etc.) constantly poll your Git server checking for updates, it can often be advantageous to use commit hooks instead. Using commit hooks removes often unnecessary Git operations (polling when there are […]