diaspora/spec/javascripts/app/views/post/day_view_spec.js
Dennis Collinson 6288eff599 day mood for a post responds to content
extract creating a post with templates to a static post view method.

Legacy templates extracted, day view

day mood shows photos and has variable text size
2012-03-27 14:54:27 -07:00

34 lines
No EOL
1.3 KiB
JavaScript

describe("app.views.Post.Day", function(){
beforeEach(function(){
this.post = factory.post()
this.view = new app.views.Post.Day({model : this.post})
})
describe("rendering", function(){
it("is happy", function(){
this.view.render()
})
describe("when the text is under 140 characters", function(){
it("has class headline", function(){
this.post.set({text : "Lol this is a short headline"})
this.view.render()
expect(this.view.$("section.text")).toHaveClass("headline")
})
})
describe("when the text is over 140 characters", function(){
it("has doesn't have headline", function(){
this.post.set({text :"Vegan bushwick tempor labore. Nulla seitan anim, aesthetic ex gluten-free viral" +
"thundercats street art. Occaecat carles deserunt lomo messenger bag wes anderson. Narwhal cray selvage " +
"dolor. Mixtape wes anderson american apparel, mustache readymade cred nulla squid veniam small batch id " +
"cupidatat. Pork belly high life consequat, raw denim sint terry richardson seitan single-origin coffee " +
"butcher. Sint yr fugiat cillum."
})
this.view.render()
expect(this.view.$("section.text")).not.toHaveClass("headline")
})
})
})
})