Skip to content

Commit

Permalink
Rename test case to make it more obvious
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardograca committed Nov 4, 2018
1 parent 32add1b commit fc66733
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/integration/json.js
@@ -1,5 +1,4 @@
var _ = require('lodash');
var Promise = global.testPromise;

module.exports = function(bookshelf) {
var isJsonSupported;
Expand Down Expand Up @@ -30,8 +29,6 @@ module.exports = function(bookshelf) {

describe('JSON support', function() {
var Models = require('./helpers/json/objects')(bookshelf).Models;

var Tank = Models.Tank;
var Command = Models.Command;

it('can `fetch` a model with a JSON column', function() {
Expand All @@ -52,12 +49,13 @@ module.exports = function(bookshelf) {
});
});

it('can update attributes without affecting _previousAttributes', function() {
return Command.forge({id: 0}).fetch()
it('returns the correct previous attributes when updating nested objects', function() {
return Command.forge({id: 0})
.fetch()
.then(function(command) {
const newTarget = {
x: 7,
y: 13,
y: 13
};
const updatedInfo = command.get('info');
updatedInfo.target = newTarget;
Expand Down

0 comments on commit fc66733

Please sign in to comment.