diaspora/spec/javascripts/app/pages/framer_spec.js
danielgrippi a1d4ca9bec Refactor composer and framer to user same layout
composer touchup; added controls to the bottom; centered input area; removed forms.Base view

Fix tests
2012-04-10 11:38:35 -07:00

36 lines
1.1 KiB
JavaScript

describe("app.pages.Framer", function(){
beforeEach(function(){
loginAs(factory.user())
app.frame = new factory.statusMessage();
this.page = new app.pages.Framer();
});
it("passes the model down to the post view", function(){
expect(this.page.postView().model).toBe(app.frame)
});
describe("rendering", function(){
beforeEach(function(){
this.page.render();
});
it("saves the model when you click done",function(){
spyOn(app.frame, "save");
this.page.$("button.done").click();
expect(app.frame.save).toHaveBeenCalled();
});
it("navigates on save", function(){
spyOn(app.router, "navigate")
this.page.model.trigger("sync")
expect(app.router.navigate).toHaveBeenCalled()
})
it("makes and renders a new post view when the template is changed", function(){
expect(app.frame.get("frame_name")).not.toBe("Night") //pre conditions, yo
this.page.$("a.mood[data-mood=Night]").click()
expect(app.frame.get("frame_name")).toBe("Night")
expect(this.page.$("article")).toHaveClass("night")
})
});
});