Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/vault.spec.js
Show First 20 Lines • Show All 286 Lines • ▼ Show 20 Lines | it('should create a revision cooking task and report its status', function() { | ||||
// Browse a revision | // Browse a revision | ||||
cy.visit(this.revisionUrl); | cy.visit(this.revisionUrl); | ||||
// Stub response to the vault API indicating to simulate archive download | // Stub response to the vault API indicating to simulate archive download | ||||
cy.intercept({url: this.vaultFetchRevisionUrl}, { | cy.intercept({url: this.vaultFetchRevisionUrl}, { | ||||
fixture: `${this.revision.replace(/:/g, '_')}.git.tar`, | fixture: `${this.revision.replace(/:/g, '_')}.git.tar`, | ||||
headers: { | headers: { | ||||
'Content-disposition': `attachment; filename=${this.revision.replace(/:/g, '_')}.git.tar`, | 'Content-disposition': `attachment; filename=${this.revision.replace(/:/g, '_')}.git.tar`, | ||||
'Content-Type': 'application/gzip' | 'Content-Type': 'application/x-tar' | ||||
} | } | ||||
}).as('fetchCookedArchive'); | }).as('fetchCookedArchive'); | ||||
// Stub responses when checking vault task status | // Stub responses when checking vault task status | ||||
const checkVaultResponses = [ | const checkVaultResponses = [ | ||||
{'exception': 'NotFoundExc'}, | {'exception': 'NotFoundExc'}, | ||||
this.genVaultRevCookingResponse('new'), | this.genVaultRevCookingResponse('new'), | ||||
this.genVaultRevCookingResponse('pending', 'Processing...'), | this.genVaultRevCookingResponse('pending', 'Processing...'), | ||||
▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | it('should offer to immediately download a bare revision git archive if already cooked', function() { | ||||
// Browse a directory | // Browse a directory | ||||
cy.visit(this.revisionUrl); | cy.visit(this.revisionUrl); | ||||
// Stub response to the vault API to simulate archive download | // Stub response to the vault API to simulate archive download | ||||
cy.intercept({url: this.vaultFetchRevisionUrl}, { | cy.intercept({url: this.vaultFetchRevisionUrl}, { | ||||
fixture: `${this.revision.replace(/:/g, '_')}.git.tar`, | fixture: `${this.revision.replace(/:/g, '_')}.git.tar`, | ||||
headers: { | headers: { | ||||
'Content-disposition': `attachment; filename=${this.revision.replace(/:/g, '_')}.git.tar`, | 'Content-disposition': `attachment; filename=${this.revision.replace(/:/g, '_')}.git.tar`, | ||||
'Content-Type': 'application/gzip' | 'Content-Type': 'application/x-tar' | ||||
} | } | ||||
}).as('fetchCookedArchive'); | }).as('fetchCookedArchive'); | ||||
// Stub responses when requesting the vault API to simulate | // Stub responses when requesting the vault API to simulate | ||||
// the directory tarball has already been cooked | // the directory tarball has already been cooked | ||||
cy.intercept(this.vaultRevisionUrl, { | cy.intercept(this.vaultRevisionUrl, { | ||||
body: this.genVaultRevCookingResponse('done') | body: this.genVaultRevCookingResponse('done') | ||||
}).as('checkVaultCookingTask'); | }).as('checkVaultCookingTask'); | ||||
Show All 32 Lines |