diaspora/spec/javascripts/app/views/open_graph_view_spec.js
Fábián Tamás László 0a4b58ac12 rspec test for GatherOpenGraphData worker
Added rspec test for og in status_message model

Added rspec test for og_html helper

Improved tests for opengraph embedding
2013-08-04 15:47:09 +02:00

30 lines
875 B
JavaScript

describe("app.views.OpenGraph", function() {
var open_graph_cache = {
"url": "http://example.com/articles/123",
"title": "Example title",
"description": "Test description",
"image": "http://example.com/thumb.jpg",
"ob_type": "article"
};
beforeEach(function(){
this.statusMessage = factory.statusMessage({
"open_graph_cache": open_graph_cache
});
this.view = new app.views.OpenGraph({model : this.statusMessage})
});
describe("rendering", function(){
it("shows the preview based on the opengraph data", function(){
this.view.render();
var html = this.view.$el.html();
expect(html).toContain(open_graph_cache.url);
expect(html).toContain(open_graph_cache.title);
expect(html).toContain(open_graph_cache.description);
expect(html).toContain(open_graph_cache.image);
});
});
});