Skip to content

Commit

Permalink
tests; fixed for #1
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Oct 18, 2012
1 parent 8c3e4a4 commit 75fa9c5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Long', function(){
before(function(done){
db = mongoose.createConnection('localhost', 'mongoose_long')
db.once('open', function () {
schema = new Schema({ long: Long });
schema = new Schema({ long: Long, name: 'string' });
S = db.model('Long', schema);
done();
});
Expand Down Expand Up @@ -141,12 +141,13 @@ describe('Long', function(){
it('works with update', function(done){
S.create({ long: 99999 }, function (err, s) {
assert.ifError(err);
S.update({ long: s.long }, { name: 'changed' }, { upsert: true }, function (err) {
S.update({ long: s.long, _id: s._id }, { name: 'changed' }, { upsert: true }, function (err) {
assert.ifError(err);

S.findById(s._id, function (err, doc) {
assert.ifError(err);
assert.deepEqual({ long: 99999, name: 'changed' }, doc);
assert.equal(99999, doc.long);
assert.equal('changed', doc.name);
done();
})
});
Expand Down

0 comments on commit 75fa9c5

Please sign in to comment.