-
Notifications
You must be signed in to change notification settings - Fork 0
Development Workflow
A complete workflow for any feature would include:
-
create a git branch for the feature
-
create your Backbone Class or use an existing class in the case of adding features to existing functionality
-
create your Jasmine spec or test for the feature in already existing spec
-
The Jasmine Spec should include tests for, in the case of a :
View: Instantiation, Rendering, and events (See EditorNodeViewSpec for example)
-
Document the class created
-
Ensure all tests, your own and others pass
-
Merge your feature branch back into dev
In order to run tests, you need to:
-
add your class(model, view, collection, router,etc) to the sirius-classes-load.coffee file in the app/coffeescripts folder, as you would for any new class being created in the system(eg. Begin.coffee)
-
Write the Jasmine Spec for the file in the app/test/spec folder (eg. BeginSpec.js)
-
In the case of a Jasmine Spec for a view class, you’ll need to add the html template(if there is one) to the test/spec/javascripts/fixtures folder
-
Add the Jasmine Spec class name(eg. BeginSpec) to the app/test/load-jasmine.js file
-
Open app/test/SpecRunner.html in the browser to run and view test results
EditorNodeViewSpec is a fully working example of testing view classes
-
http://addyosmani.github.com/backbone-fundamentals/#testing-jasmine-views
-
http://tinnedfruit.com/2011/04/26/testing-backbone-apps-with-jasmine-sinon-3.html
-
Backbone model extension code
-
Backbone collection code
-
Backbone view code
-
Integration testing (scenario.from_xml should work and load all its children correctly, etc.)
-
Backbone boilerplate model code (smoke tests)