diff --git a/test/src/API/templates/templates.test.js b/test/src/API/templates/templates.test.js index 98ecf2ea5..95b8c1ff6 100644 --- a/test/src/API/templates/templates.test.js +++ b/test/src/API/templates/templates.test.js @@ -113,17 +113,12 @@ describe('Template API tests', function() { }); describe('a duplicate url', function() { it('should return 400', async function() { - // Arrange - const res = await getTemplateRepos(); - const originalTemplateRepos = res.body; - const duplicateRepoUrl = originalTemplateRepos[0].url; - // Act - const duplicateUrlRes = await addTemplateRepo({ - url: duplicateRepoUrl, + const { body: [existingRepo] } = await getTemplateRepos(); + const res = await addTemplateRepo({ + url: existingRepo.url, description: 'duplicate url', }); - // Assert - duplicateUrlRes.should.have.status(400, duplicateUrlRes.text); + res.should.have.status(400, res.text); }); }); describe('a valid url that does not point to an index.json', function() {