Enable JSHINT's unused option. It caught a bunch of suspicious stuff which is fixed in this commit.

This commit is contained in:
Robin Ward
2013-12-30 13:29:52 -05:00
parent 8685e4079f
commit a502266c42
59 changed files with 69 additions and 102 deletions

View File

@ -1,7 +1,7 @@
module("Discourse.Composer");
test('replyLength', function() {
var replyLength = function(val, expectedLength, text) {
var replyLength = function(val, expectedLength) {
var composer = Discourse.Composer.create({ reply: val });
equal(composer.get('replyLength'), expectedLength);
};

View File

@ -227,7 +227,7 @@ test("storePost", function() {
test("identity map", function() {
var postStream = buildStream(1234);
var p1 = postStream.appendPost(Discourse.Post.create({id: 1, post_number: 1}));
var p3 = postStream.appendPost(Discourse.Post.create({id: 3, post_number: 4}));
postStream.appendPost(Discourse.Post.create({id: 3, post_number: 4}));
equal(postStream.findLoadedPost(1), p1, "it can return cached posts by id");
blank(postStream.findLoadedPost(4), "it can't find uncached posts");
@ -403,7 +403,7 @@ test("comitting and triggerNewPostInStream race condition", function() {
var user = Discourse.User.create({username: 'eviltrout', name: 'eviltrout', id: 321});
var stagedPost = Discourse.Post.create({ raw: 'hello world this is my new post' });
var result = postStream.stagePost(stagedPost, user);
postStream.stagePost(stagedPost, user);
equal(postStream.get('filteredPostsCount'), 0, "it has no filteredPostsCount yet");
stagedPost.set('id', 123);