Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save osscontributor/e3ad4f6fb20debf881aeb6b9cc4653a5 to your computer and use it in GitHub Desktop.
Save osscontributor/e3ad4f6fb20debf881aeb6b9cc4653a5 to your computer and use it in GitHub Desktop.
void "Deleting a valid file from an existent part" (){
given:
List <Metafile> sampleMetafiles = [new Metafile(id: '1111111111', filename: 'test.pdf', title: '',
description: '', uploadedOn: new Date(),
partId: '2222222222', uploadedBy: 'Alfred', userId: '333333333'),
new Metafile(id: '1111111112', filename: 'test2.pdf', title: '',
description: '', uploadedOn: new Date(),
partId: '2222222221', uploadedBy: 'Alfred', userId: '333333334')
]
when:
request.method = 'DELETE'
request.setParameter("partId","2222222222")
request.setParameter("fileId","1111111111")
controller.deleteMetafiles()
then:
println(model.size())
model.size() == 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment