mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +01:00
test for recent posts, fix redirect test
This commit is contained in:
@@ -532,6 +532,15 @@ describe('Controllers', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should get recent posts', function (done) {
|
||||
request(nconf.get('url') + '/api/recent/posts/month', function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 200);
|
||||
assert(body);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should get post data', function (done) {
|
||||
request(nconf.get('url') + '/api/post/pid/' + pid, function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
@@ -943,7 +952,7 @@ describe('Controllers', function () {
|
||||
|
||||
describe('post redirect', function () {
|
||||
it('should 404 for invalid pid', function (done) {
|
||||
request(nconf.get('url') + '/post/fail', function (err, res) {
|
||||
request(nconf.get('url') + '/api/post/fail', function (err, res) {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 404);
|
||||
done();
|
||||
|
||||
Reference in New Issue
Block a user