Skip to content

Instantly share code, notes, and snippets.

@davidvanleeuwen
Created April 3, 2013 22:34
Show Gist options
  • Save davidvanleeuwen/5306080 to your computer and use it in GitHub Desktop.
Save davidvanleeuwen/5306080 to your computer and use it in GitHub Desktop.
describe 'Backbone.Modal', ->
view = {}
modal = {}
beforeEach ->
class modal extends Backbone.Modal
viewContainer: ''
cancelEl: ''
submitEl: ''
template: -> ''
views:
'click .class':
view: -> ''
'click #id':
view: -> ''
view = new modal()
afterEach ->
modal = {}
view = {}
it "should have Backbone defined", ->
expect(Backbone).toBeDefined()
it 'should throw an exception if there is no template or views present', ->
delete modal::views
delete modal::template
expect(-> view.render()).toThrow()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment