Skip to content

Commit

Permalink
Skip this test with Ember-Data 2.0.x
Browse files Browse the repository at this point in the history
It fails due to emberjs/data#3736, which is fixed in Ember-Data v2.1.0.
  • Loading branch information
rsutphin committed Dec 5, 2015
1 parent 3efdffe commit 8f004d2
Showing 1 changed file with 31 additions and 26 deletions.
57 changes: 31 additions & 26 deletions tests/integration/adapters/pouch-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,36 +158,41 @@ test('create a new record', function (assert) {
});
});

test('update an existing record', function (assert) {
assert.expect(2);
// This test fails due to a bug in ember data
// (https://github.com/emberjs/data/issues/3736)
// starting with ED v2.0.0-beta.1. It works again with ED v2.1.0.
if (!DS.VERSION.match(/^2\.0/)) {
test('update an existing record', function (assert) {
assert.expect(2);

var done = assert.async();
Ember.RSVP.Promise.resolve().then(() => {
return db().bulkDocs([
{ _id: 'tacoSoup_2_C', data: { flavor: 'al pastor' } },
{ _id: 'tacoSoup_2_D', data: { flavor: 'black bean' } },
]);
}).then(() => {
return store().find('taco-soup', 'C');
}).then((found) => {
found.set('flavor', 'pork');
return found.save();
}).then(() => {
return db().get('tacoSoup_2_C');
}).then((updatedDoc) => {
assert.equal(updatedDoc.data.flavor, 'pork', 'should have updated the attribute');
var done = assert.async();
Ember.RSVP.Promise.resolve().then(() => {
return db().bulkDocs([
{ _id: 'tacoSoup_2_C', data: { flavor: 'al pastor' } },
{ _id: 'tacoSoup_2_D', data: { flavor: 'black bean' } },
]);
}).then(() => {
return store().find('taco-soup', 'C');
}).then((found) => {
found.set('flavor', 'pork');
return found.save();
}).then(() => {
return db().get('tacoSoup_2_C');
}).then((updatedDoc) => {
assert.equal(updatedDoc.data.flavor, 'pork', 'should have updated the attribute');

var recordInStore = store().peekRecord('tacoSoup', 'C');
assert.equal(updatedDoc._rev, recordInStore.get('rev'),
'should have associated the ember-data record with the updated rev');
var recordInStore = store().peekRecord('tacoSoup', 'C');
assert.equal(updatedDoc._rev, recordInStore.get('rev'),
'should have associated the ember-data record with the updated rev');

done();
}).catch((error) => {
console.error('error in test', error);
assert.ok(false, 'error in test:' + error);
done();
done();
}).catch((error) => {
console.error('error in test', error);
assert.ok(false, 'error in test:' + error);
done();
});
});
});
}

test('delete an existing record', function (assert) {
assert.expect(1);
Expand Down

0 comments on commit 8f004d2

Please sign in to comment.