Commit efa2f43f authored by Dennis Schubert's avatar Dennis Schubert
Browse files

Merge pull request #5793 from svbergerem/uncomment-jasmine-tests

Uncomment jasmine tests
parents 5115582c a161e4d3
describe("app.views.Feedback", function(){
beforeEach(function(){
loginAs({id : -1, name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}});
this.userAttrs = _.extend(factory.userAttrs(), {guid : -1});
loginAs(this.userAttrs);
Diaspora.I18n.load({stream : {
'like' : "Like",
......@@ -55,19 +56,18 @@ describe("app.views.Feedback", function(){
});
it("the like action should be 'Like'", function(){
expect(this.link().text()).toContain(Diaspora.I18n.t('stream.like'));
expect(this.link().text()).toContain(Diaspora.I18n.t("stream.like"));
});
it("allows for unliking a just-liked post", function(){
// callback stuff.... we should fix this
// expect(this.link().text()).toContain(Diaspora.I18n.t('stream.like'))
// this.link().click();
// expect(this.link().text()).toContain(Diaspora.I18n.t('stream.unlike'))
// this.link().click();
// expect(this.link().text()).toContain(Diaspora.I18n.t('stream.like'))
var responseText = JSON.stringify({"author": this.userAttrs});
var ajax_success = { status: 201, responseText: responseText };
expect(this.link().text()).toContain(Diaspora.I18n.t("stream.like"));
this.link().click();
jasmine.Ajax.requests.mostRecent().respondWith(ajax_success);
expect(this.link().text()).toContain(Diaspora.I18n.t("stream.unlike"));
this.link().click();
expect(this.link().text()).toContain(Diaspora.I18n.t("stream.like"));
});
});
});
......
......@@ -16,24 +16,24 @@ describe("app.views.Photos", function() {
}, this);
});
// describe("initialize", function() {
// it("binds an infinite scroll listener", function() {
// spyOn($.fn, "scroll");
// new app.views.Stream({model : this.stream});
// expect($.fn.scroll).toHaveBeenCalled();
// });
// });
//
// describe("#render", function() {
// beforeEach(function() {
// this.photo = this.stream.items.models[0];
// this.photoElement = $(this.view.$("#" + this.photo.get("guid")));
// });
//
// context("when rendering a photo message", function() {
// it("shows the photo in the content area", function() {
// expect(this.photoElement.length).toBeGreaterThan(0); //markdown'ed
// });
// });
// });
describe("initialize", function() {
it("binds an infinite scroll listener", function() {
spyOn($.fn, "scroll");
new app.views.Stream({model : this.stream});
expect($.fn.scroll).toHaveBeenCalled();
});
});
describe("#render", function() {
beforeEach(function() {
this.photo = this.stream.items.models[0];
this.photoElement = $(this.view.$("#" + this.photo.get("guid")));
});
context("when rendering a photo message", function() {
it("shows the photo in the content area", function() {
expect(this.photoElement.length).toBeGreaterThan(0);
});
});
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment