Add robotsTxt tests

This commit is contained in:
Girish Ramakrishnan
2019-09-09 21:41:55 -07:00
parent 6f53723169
commit 79f9963792
3 changed files with 76 additions and 10 deletions

View File

@@ -1040,6 +1040,47 @@ describe('App API', function () {
});
});
describe('configure robotsTxt', function () {
it('fails with missing robotsTxt', function (done) {
superagent.post(SERVER_URL + '/api/v1/apps/' + APP_ID + '/configure/robots_txt')
.query({ access_token: token })
.end(function (err, res) {
expect(res.statusCode).to.equal(400);
done();
});
});
it('fails with bad robotsTxt', function (done) {
superagent.post(SERVER_URL + '/api/v1/apps/' + APP_ID + '/configure/robots_txt')
.query({ access_token: token })
.send({ robotsTxt: 34 })
.end(function (err, res) {
expect(res.statusCode).to.equal(400);
done();
});
});
it('can set robotsTxt', function (done) {
superagent.post(SERVER_URL + '/api/v1/apps/' + APP_ID + '/configure/robots_txt')
.query({ access_token: token })
.send({ robotsTxt: 'any string is good' })
.end(function (err, res) {
expect(res.statusCode).to.equal(200);
done();
});
});
it('can reset robotsTxt', function (done) {
superagent.post(SERVER_URL + '/api/v1/apps/' + APP_ID + '/configure/robots_txt')
.query({ access_token: token })
.send({ robotsTxt: null })
.end(function (err, res) {
expect(res.statusCode).to.equal(200);
done();
});
});
});
describe('configure location', function () {
it('cannot reconfigure app with missing domain', function (done) {
superagent.post(SERVER_URL + '/api/v1/apps/' + APP_ID + '/configure/location')