Add robotsTxt tests
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user