Skip to content

Development Workflow

sean-morris edited this page Jul 26, 2012 · 3 revisions

Workflow:

A complete workflow for any feature would include:

  1. create a git branch for the feature

  2. create your Backbone Class or use an existing class in the case of adding features to existing functionality

  3. create your Jasmine spec or test for the feature in already existing spec

  4. The Jasmine Spec should include tests for, in the case of a :

    View: Instantiation, Rendering, and events (See EditorNodeViewSpec for example)

  5. Document the class created

  6. Ensure all tests, your own and others pass

  7. Merge your feature branch back into dev

Testing Procedure:

In order to run tests, you need to:

  1. 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)

  2. Write the Jasmine Spec for the file in the app/test/spec folder (eg. BeginSpec.js)

  3. 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

  4. Add the Jasmine Spec class name(eg. BeginSpec) to the app/test/load-jasmine.js file

  5. Open app/test/SpecRunner.html in the browser to run and view test results

Test Example:

EditorNodeViewSpec is a fully working example of testing view classes

Testing References:

JS Test priorities (high to low)

  1. Backbone model extension code

  2. Backbone collection code

  3. Backbone view code

  4. Integration testing (scenario.from_xml should work and load all its children correctly, etc.)

  5. Backbone boilerplate model code (smoke tests)

Clone this wiki locally