Skip to content

Commit

Permalink
Reenabling test for SSESpecification
Browse files Browse the repository at this point in the history
  • Loading branch information
fishcharlie committed Apr 1, 2018
1 parent 4f783bb commit 31ea989
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ var buildTableReq = Table.prototype.buildTableReq = function buildTableReq(name,
createTableReq.GlobalSecondaryIndexes = globalSecIndexes;
}

if (table && table.options && table.options.serverSideEncryption) {
if (this && this.options && this.options.serverSideEncryption) {
createTableReq.SSESpecification = {
'Enabled': true
};
Expand Down
20 changes: 7 additions & 13 deletions test/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('Model', function (){
Cats.Cat2.should.have.property('name');
// Older node doesn't support Function.name changes
if (Object.getOwnPropertyDescriptor(Function, 'name').configurable) {
Cats.Cat2.name.should.eql('Model-test-Cat2');
Cats.Cat2.name.should.eql('Model-test-Cat2-db');
}

Cats.Cat2.should.have.property('$__');
Expand Down Expand Up @@ -149,7 +149,7 @@ describe('Model', function (){
Cats.Cat5.should.have.property('name');
// Older node doesn't support Function.name changes
if (Object.getOwnPropertyDescriptor(Function, 'name').configurable) {
Cats.Cat5.name.should.eql('Model-test-Cat5');
Cats.Cat5.name.should.eql('Model-test-Cat5-db');
}

Cats.Cat5.should.have.property('$__');
Expand Down Expand Up @@ -212,7 +212,7 @@ describe('Model', function (){
Cats.Cat1.should.have.property('name');
// Older node doesn't support Function.name changes
if (Object.getOwnPropertyDescriptor(Function, 'name').configurable) {
Cats.Cat1.name.should.eql('Model-test-Cat1');
Cats.Cat1.name.should.eql('Model-test-Cat1-db');
}

Cats.Cat1.should.have.property('$__');
Expand Down Expand Up @@ -646,16 +646,10 @@ describe('Model', function (){

// See comments on PR #306 for details on why the test below is commented out

// it('Should enable server side encryption', function(done) {
// var Model = dynamoose.model('TestTable', { id: Number, name: String }, { serverSideEncryption: true });
// setTimeout(function () {
// Model.$__.table.describe(function(err, data) {
// console.log(err, data);
// data.Table.SSEDescription.Status.should.equal("ENABLED");
// done();
// });
// }, 2000);
// });
it('Should enable server side encryption', function() {
var Model = dynamoose.model('TestTable', { id: Number, name: String }, { serverSideEncryption: true });
Model.getTableReq().SSESpecification.Enabled.should.be.true;
});

it('Server side encryption shouldn\'t be enabled unless specified', function(done) {
var Model = dynamoose.model('TestTableB', { id: Number, name: String });
Expand Down

0 comments on commit 31ea989

Please sign in to comment.