mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-03 05:09:48 +01:00
tests: topic.js: naming flow fix for .post
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
|
||||
|
||||
|
||||
var winston = require('winston');
|
||||
|
||||
process.on('uncaughtException', function (err) {
|
||||
@@ -19,19 +16,19 @@ reds.createClient = function () {
|
||||
|
||||
var Topics = require('../src/topics');
|
||||
|
||||
describe('Topics', function() {
|
||||
describe('Topic\'s', function() {
|
||||
var newTopic;
|
||||
var newPost;
|
||||
var userInfo;
|
||||
|
||||
describe('.post', function() {
|
||||
it('should post a new topic', function(done) {
|
||||
var uid = 1,
|
||||
cid = 1,
|
||||
it('should create a new topic with proper parameters', function(done) {
|
||||
var userId = 1,
|
||||
categoryId = 1,
|
||||
title = 'Test Topic Title',
|
||||
content = 'The content of test topic';
|
||||
|
||||
Topics.post(uid, title, content, cid, function(err, result) {
|
||||
Topics.post(userId, title, content, categoryId, function(err, result) {
|
||||
assert.equal(err, null, 'was created with error');
|
||||
assert.ok(result);
|
||||
|
||||
@@ -42,7 +39,7 @@ describe('Topics', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should fail posting a topic', function(done) {
|
||||
it('should fail to create new topic with wrong parameters', function(done) {
|
||||
var uid = null,
|
||||
cid = 1,
|
||||
title = 'Test Topic Title',
|
||||
|
||||
Reference in New Issue
Block a user