diff --git a/mocks/databasemock.js b/mocks/databasemock.js index 89e5f850e7..7a2a11ca60 100644 --- a/mocks/databasemock.js +++ b/mocks/databasemock.js @@ -55,23 +55,29 @@ nconf.set(dbType, testDbConfig); - db = require('../src/database'); + var db = require('../src/database'), + meta = require('../src/meta'); + before(function(done) { db.init(function(err) { //Clean up db.flushdb(function(err) { - if(err){ + if(err) { winston.error(err); throw new Error(err); - } else { - winston.info('test_database flushed'); - done(); } - //TODO: data seeding, if needed at all + winston.info('test_database flushed'); + meta.configs.init(function () { + var webserver = require('../src/webserver'), + sockets = require('../src/socket.io'); + sockets.init(webserver.server); + + done(); + }); }); }); }); diff --git a/public/src/forum/login.js b/public/src/forum/login.js index 11afd12cdc..de0defd54a 100644 --- a/public/src/forum/login.js +++ b/public/src/forum/login.js @@ -52,7 +52,7 @@ define(function() { return false; }); - $('#content input').focus(); + $('#content #username').focus(); }; return Login; diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 6383cac823..a83e0493ce 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -622,7 +622,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { socket.on('get_users_in_room', function(data) { if(data && data.room.indexOf('topic') !== -1) { - var activeEl = $('li.post-bar[data-index="0"] .thread_active_users'); + var activeEl = $('.thread_active_users'); function createUserIcon(uid, picture, userslug, username) { if(!activeEl.find('[data-uid="' + uid + '"]').length) { @@ -694,11 +694,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { // Get users who are currently replying to the topic entered socket.emit('modules.composer.getUsersByTid', templates.get('topic_id'), function(err, uids) { - var activeUsersEl = $('.thread_active_users'), - x; if (uids && uids.length) { for(var x=0;x