| It still seems more like unit tests.. For example this line states that if you are given 20 records that 20 make it into the view. expect(view.$('.persons li').length).toEqual(20); This mocks out the server to give 20 results back and simply tests that the template iterates over the returned collection (given that the 'reset' binding for view.render is in place). You are specifically not in an 'integration'. As for the argument for not using capybara for speed reasons - it seems that the speed difference is acceptable given the confidence and power it gives you. This is not the same as an integration (acceptance) test. Whence you mock the server you can no longer be confident that a breaking change was not introduced across the stack. The purpose of integration tests is that you are the user, and express your functionality in the same manner that the user would. This is not that. It is therefore not an integration test. |
And yes, I totally agree with you regarding the confidence we can have when we mock out our server-side application. But in the context we were working it would be a world of pain to have proper acceptance tests going through the entire stack. They would also take much, much longer time than about a second (we are not in a regular database type application using Rails and all that, this is an enterprise project with many, many years of legacy code in it and an ESB and whatnot).
The purpose of these tests for us is first of all to be able to deliver functionality fast and with high confidence, which they, beyond a doubt, has helped us with.