diaspora/spec/javascripts/app/views/template_picker_view_spec.js
Dennis Collinson 78a2ed28b9 User can select Night and Day Moods
headline method on post

extract headline and body from post, at first newline

Night Mood
2012-03-28 16:22:05 -07:00

28 lines
No EOL
914 B
JavaScript

describe("app.views.TemplatePicker", function(){
beforeEach(function(){
this.model = factory.statusMessage({frame_name: undefined})
this.view = new app.views.TemplatePicker({model : this.model })
})
describe("initialization", function(){
it("sets the frame_name of the model to 'status' by default", function(){
expect(this.view.model.get("frame_name")).toBe("Day")
})
})
describe("rendering", function(){
beforeEach(function(){
this.view.render()
})
it("selects the model's frame_name from the dropdown", function(){
expect(this.view.$("select[name=template]").val()).toBe("Day")
})
it("changes the frame_name on the model when is is selected", function(){
this.view.$("select[name=template]").val("Night")
this.view.$("select[name=template]").trigger("change")
expect(this.model.get("frame_name")).toBe('Night')
})
})
})