fix jasmine unhappiness I introduced with #3088

This commit is contained in:
Florian Staudacher 2012-04-02 21:25:01 +02:00
parent 4b41f8bf41
commit 1709036764

View file

@ -31,7 +31,16 @@ describe("app.views.CommentStream", function(){
describe("createComment", function(){ describe("createComment", function(){
it("clears the new comment textarea", function(){ it("clears the new comment textarea", function(){
$(this.view.el).html($("<textarea/>", {"class" : 'comment_box'}).val("hey")) var comment = {
"id": 1234,
"text": "hey",
"author": "not_null"
};
spyOn($, "ajax").andCallFake(function(params) {
params.success(comment);
});
$(this.view.el).html($("<textarea/>", {"class" : 'comment_box'}).val(comment.text))
this.view.createComment() this.view.createComment()
expect(this.view.$(".comment_box").val()).toBe("") expect(this.view.$(".comment_box").val()).toBe("")
}) })