Archive for October, 2011

Testing CoffeeScript apps with Selenium

October 25, 2011

Published: 2011-10-25

This blog entry describes how to write functional tests for CoffeeScript web apps using Selenium. By way of example I’ll describe how I added Selenium tests to the Routeless Backbone Contacts tutorial app and automated it’s execution with a Cakefile.

(more…)

Advertisements

Compiling CoffeeScript with Vim

October 20, 2011

Published: 2011-10-20
Updated: 2012-04-24
Updated: 2012-06-19

You can configure Vim to automatically compile CoffeeScript files when you save them from within Vim, it’s easy, just add an autocmd to run the CoffeeScript compiler to your ~/.vimrc file:

(more…)

Getters and Setters for Backbone Model attributes

October 16, 2011

Published: 2011-10-16

The Backbone.js Model class provides get and set methods to read and write Model attributes which is not a concise or natural as object property access. But it’s not difficult to add a class method to generate Model getter/setter properties so that you can do this in CoffeeScript:

person.name = 'Joe Bloggs'
ph = person.phone

instead of this:

person.set {name: 'Joe Bloggs'}
ph = person.get 'name'

(more…)

Routeless Backbone Contacts 2.0

October 2, 2011

Published: 2011-10-03
Updated: 2011-10-25

This post describes a revamped version 2.0 of my original Routeless Backbone Contacts application. The material covered here builds on the original post.

  1. The basic application functionality and the underlying data remains the same.
  2. The new user interface is a single two-pane page with a selectable list of contacts on the left and contact details on the right.
  3. A Search box has been added to incrementally filter the list of displayed contacts.
  4. The application is 100% event driven — there is no direct coupling between the views. Backbone.js events emitted by the underlying contact data collection ensure the views are updated automatically when the state of the underlying data changes.

(more…)