Updated coverage
This commit is contained in:
+1
-1
@@ -160,7 +160,7 @@ module.exports = (config) => {
|
|||||||
});
|
});
|
||||||
lastRSS = feed.xml();
|
lastRSS = feed.xml();
|
||||||
}
|
}
|
||||||
res.type(req.headers['user-agent'].match(/Mozilla/) ? 'xml' : 'rss').send(lastRSS);
|
res.type(req.headers['user-agent'].match(/Mozilla/) ? 'text/xml' : 'rss').send(lastRSS);
|
||||||
} else {
|
} else {
|
||||||
showError(req.path, 404, res);
|
showError(req.path, 404, res);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,6 +181,13 @@ describe('Test RSS feed', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
test('200 Mozilla fix', (done) => {
|
||||||
|
request(app).get('/rsstest').set('user-agent', 'Mozilla Firefox 64.0').then((response) => {
|
||||||
|
expect(response.statusCode).toBe(200);
|
||||||
|
expect(response.type).toBe('text/xml');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
test('200 rss cache', (done) => {
|
test('200 rss cache', (done) => {
|
||||||
request(app).get('/rsstest').then(() => {
|
request(app).get('/rsstest').then(() => {
|
||||||
request(app).get('/rsstest').then((response) => {
|
request(app).get('/rsstest').then((response) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user