Created
October 29, 2011 19:34
-
-
Save searls/1324964 to your computer and use it in GitHub Desktop.
Example JavaScript!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']); | |
}); | |
}); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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