Skip to content

Instantly share code, notes, and snippets.

@searls
Created October 29, 2011 19:34
Show Gist options
  • Save searls/1324964 to your computer and use it in GitHub Desktop.
Save searls/1324964 to your computer and use it in GitHub Desktop.
Example JavaScript!
describe('CallList', function() {
var subject;
beforeEach(function() {
subject = new CallList({items: ['A','B','C']});
});
describe("#moveUp", function() {
context("moving up C", function() {
beforeEach(function() {
subject.moveUp('C');
});
it("places it above B", function() {
expect(subject.get('items')).toEqual(['A','C','B']);
});
});
});
});
window.CallList = Backbone.Model.extend({
moveUp: function(item) {
this.set({items: ['A','C','B']});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment