Skip to content

Commit 8490fd1

Browse files
author
Seth Pollack
committed
add tests
1 parent b7f019b commit 8490fd1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/unit/lib/s3-nodetest.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,36 @@ describe('s3', function() {
114114
assert.equal(s3Params.CacheControl, 'max-age=1234, public');
115115
assert.equal(s3Params.Expires, '2010');
116116
assert.isUndefined(s3Params.ContentEncoding);
117+
assert.isUndefined(s3Params.ServerSideEncryption);
117118
});
118119
});
119120

121+
it('sets ServerSideEncryption using serverSideEncryption', function() {
122+
var s3Params;
123+
s3Client.putObject = function(params, cb) {
124+
s3Params = params;
125+
cb();
126+
};
127+
128+
var options = {
129+
filePaths: ['app.css'],
130+
cwd: process.cwd() + '/tests/fixtures/dist',
131+
prefix: 'js-app',
132+
acl: 'public-read',
133+
bucket: 'some-bucket',
134+
cacheControl: 'max-age=1234, public',
135+
expires: '2010',
136+
serverSideEncryption: 'AES256'
137+
};
138+
139+
var promise = subject.upload(options);
140+
141+
return assert.isFulfilled(promise)
142+
.then(function() {
143+
assert.equal(s3Params.ServerSideEncryption, 'AES256', 'ServerSideEncryption passed correctly');
144+
});
145+
});
146+
120147
it('sends the correct content type params for gzipped files with .gz extension', function() {
121148
var s3Params;
122149
s3Client.putObject = function(params, cb) {

0 commit comments

Comments
 (0)