clear new comment on submit; include the newer autoexpander in jasmine

This commit is contained in:
danielgrippi 2012-01-20 21:58:07 -08:00
parent 25d0f0d87f
commit 9e3521396d
3 changed files with 10 additions and 2 deletions

View file

@ -29,7 +29,7 @@ app.views.CommentStream = app.views.Base.extend({
"text" : this.$(".comment_box").val()
});
this.$(".comment_box").empty()
this.$(".comment_box").val("")
return this;
},

View file

@ -18,4 +18,12 @@ describe("app.views.CommentStream", function(){
expect($.fn.autoResize.mostRecentCall.object.selector).toBe("textarea")
})
})
describe("createComment", function(){
it("clears the new comment textarea", function(){
$(this.view.el).html($("<textarea/>", {"class" : 'comment_box'}).val("hey"))
this.view.createComment()
expect(this.view.$(".comment_box").val()).toBe("")
})
})
})

View file

@ -17,7 +17,7 @@ src_files:
- public/javascripts/vendor/bootstrap/bootstrap-twipsy.js
- public/javascripts/vendor/jquery.tipsy.js
- public/javascripts/vendor/jquery.infinitescroll.min.js
- public/javascripts/vendor/jquery.autoresize.min.js
- public/javascripts/vendor/jquery.autoresize.js
- public/javascripts/vendor/jquery.expander.js
- public/javascripts/vendor/jquery.charcount.js
- public/javascripts/vendor/timeago.js