diaspora/spec/javascripts/app/views/photo_viewer_spec.js
2015-02-08 23:41:31 +01:00

19 lines
678 B
JavaScript

describe("app.views.PhotoViewer", function(){
beforeEach(function(){
this.model = factory.post({
photos : [
factory.photoAttrs({sizes : {large : "http://tieguy.org/me.jpg"}}),
factory.photoAttrs({sizes : {large : "http://whatthefuckiselizabethstarkupto.com/none_knows.gif"}}) //SIC
]
});
this.view = new app.views.PhotoViewer({model : this.model});
});
describe("rendering", function(){
it("should have an image for each photoAttr on the model", function(){
this.view.render();
expect(this.view.$("img").length).toBe(2);
expect(this.view.$("img[src='http://tieguy.org/me.jpg']")).toExist();
});
});
});