+
+ it('Should serve the endpoint with a classic request', async function () {
+ await makeGetRequest({
+ url: servers[0].url,
+ path: '/feeds/videos.xml',
+ accept: 'application/xml',
+ expectedStatus: HttpStatusCode.OK_200
+ })
+ })
+
+ it('Should serve the endpoint as a cached request', async function () {
+ const res = await makeGetRequest({
+ url: servers[0].url,
+ path: '/feeds/videos.xml',
+ accept: 'application/xml',
+ expectedStatus: HttpStatusCode.OK_200
+ })
+
+ expect(res.headers['x-api-cache-cached']).to.equal('true')
+ })
+
+ it('Should not serve the endpoint as a cached request', async function () {
+ const res = await makeGetRequest({
+ url: servers[0].url,
+ path: '/feeds/videos.xml?v=186',
+ accept: 'application/xml',
+ expectedStatus: HttpStatusCode.OK_200
+ })
+
+ expect(res.headers['x-api-cache-cached']).to.not.exist
+ })
+
+ it('Should refuse to serve the endpoint without accept header', async function () {
+ await makeGetRequest({ url: servers[0].url, path: '/feeds/videos.xml', expectedStatus: HttpStatusCode.NOT_ACCEPTABLE_406 })
+ })