I'm trying to write a simple spec for a Backbone Todos collection which stubs the Backbone Todo model.
Here's my spec:
describe "TodoApp.Collections.Todos", ->
beforeEach ->
@todoStub = sinon.stub window, 'TodoApp.Models.Todo'
afterEach ->
@todoStub.restore()
This gives me the following error:
TypeError: Attempted to wrap undefined property TodoApp.Models.Todo as function
The Todo model is defined though as todo = new TodoApp.Models.Todo() doens't give an error.
Is it a scoping issue? Could somebody point me in the right direction?