Skip to content

Commit

Permalink
Fix wrong model being saved in PostgreSQL test
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardograca committed Dec 9, 2018
1 parent f0d7d63 commit bad8157
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/integration/model.js
Expand Up @@ -1587,7 +1587,7 @@ module.exports = function(bookshelf) {
return bookshelf.Collection.extend({
model: Models.Site
})
.forge({id: 1})
.forge()
.fetch()
.then(function(sites) {
expect(sites.at(0).previousAttributes()).to.eql(sites.at(0).attributes);
Expand Down Expand Up @@ -1618,7 +1618,7 @@ module.exports = function(bookshelf) {
return bookshelf.Collection.extend({
model: Models.Site
})
.forge({id: 1})
.forge()
.fetch()
.then(function(sites) {
var site = sites.at(0);
Expand Down Expand Up @@ -1685,15 +1685,15 @@ module.exports = function(bookshelf) {
initialize: function() {
this.on('updated', function(site) {
expect(site.previousAttributes()).to.eql(site.attributes);
new Models.Site({id: 1}).save({name: originalAttributes.name}).finally(() => done());
new Models.Site({id: originalAttributes.id}).save({name: originalAttributes.name}).finally(() => done());
});
}
});
var Sites = bookshelf.Collection.extend({
model: SiteModel
});

Sites.forge({id: 1})
Sites.forge()
.fetch()
.then(function(sites) {
var site = sites.at(0);
Expand Down

0 comments on commit bad8157

Please sign in to comment.