Skip to content

Commit

Permalink
just one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
richardgirges committed Feb 20, 2017
1 parent 9785534 commit ac309ee
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion test/multipartUploads.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe('Test Upload With Fields', function() {
for (let i = 0; i < mockFiles.length; i++) {
let fileName = mockFiles[i];

it(`upload ${fileName} and submit fields at the same time`, function(done) {
it(`upload ${fileName} and submit fields at the same time with POST`, function(done) {
let filePath = path.join(fileDir, fileName);
let uploadedFilePath = path.join(uploadDir, fileName);

Expand All @@ -186,5 +186,30 @@ describe('Test Upload With Fields', function() {
fs.stat(uploadedFilePath, done);
});
});

it(`upload ${fileName} and submit fields at the same time with PUT`, function(done) {
let filePath = path.join(fileDir, fileName);
let uploadedFilePath = path.join(uploadDir, fileName);

clearUploadsDir();

request(app)
.put('/upload/single/withfields')
.attach('testFile', filePath)
.field('firstName', mockUser.firstName)
.field('lastName', mockUser.lastName)
.field('email', mockUser.email)
.expect(200, {
firstName: mockUser.firstName,
lastName: mockUser.lastName,
email: mockUser.email
},
function(err, res) {
if (err)
return done(err);

fs.stat(uploadedFilePath, done);
});
});
}
});

0 comments on commit ac309ee

Please sign in to comment.