diaspora/spec/javascripts/app/pages/post_new_spec.js
2012-03-27 14:52:52 -07:00

32 lines
No EOL
910 B
JavaScript

describe("app.pages.PostNew", function(){
beforeEach(function(){
this.page = new app.pages.PostNew()
})
describe("rendering", function(){
beforeEach(function(){
this.page.render();
})
describe("clicking next", function(){
beforeEach(function(){
spyOn(app.router, "navigate")
spyOn(this.page.postForm, "setModelAttributes")
this.page.$("button.next").click()
})
it("calls tells the form to set the models attributes", function(){
expect(this.page.postForm.setModelAttributes).toHaveBeenCalled();
});
it("stores a reference to the form as app.composer" , function(){
expect(this.page.model).toBeDefined()
expect(app.frame).toBe(this.page.model)
});
it("navigates to the framer", function(){
expect(app.router.navigate).toHaveBeenCalledWith("framer", true)
});
})
})
});