How to use the ember-data-factory-guy.mockDelete function in ember-data-factory-guy

To help you get started, we’ve selected a few ember-data-factory-guy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let profile = make('profile');

      let deleteMock = mockDelete(profile).fails();

      profile.destroyRecord()
             .catch(() => assert.ok(true, 'delete failed the first time'))
             .then(() => {
               deleteMock.succeeds();

               profile.destroyRecord().then(function() {
                 assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 0);
                 done();
               });
             });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let profile = make('profile');
      mockDelete(profile);

      profile.destroyRecord().then(function() {
        assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 0);
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let profile = make('profile');
      mockDelete('profile', profile.id);

      profile.destroyRecord().then(function() {
        assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 0);
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let employee = make('employee');
      mockDelete(employee);

      employee.destroyRecord().then(function() {
        assert.equal(FactoryGuy.store.peekAll('employee').get('content.length'), 0);
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let profiles = makeList('profile', 2);
      let profile = profiles[0];
      let deleteMock = mockDelete('profile').fails();

      profile.destroyRecord()
             .catch(() => assert.ok(true, 'delete failed the first time'))
             .then(() => {
               deleteMock.succeeds();

               profile.destroyRecord().then(function() {
                 assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 1);
                 done();
               });
             });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let profiles = makeList('profile', 2);
      let profile = profiles[0];
      let deleteMock = mockDelete('profile').fails();

      profile.destroyRecord()
             .catch(() => assert.ok(true, 'delete failed the first time'))
             .then(() => {
               deleteMock.succeeds();

               profile.destroyRecord().then(function() {
                 assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 1);
                 done();
               });
             });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let profile = make('profile');
      let mock = mockDelete('profile', profile.id).fails({status: 500});

      profile.destroyRecord().catch(function(reason) {
        let error = reason.errors[0];
        assert.equal(error.status, "500");
        assert.equal(mock.timesCalled, 1);
        assert.ok(true);
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let profiles = makeList('profile', 2);
      let profile = profiles[0];
      mockDelete('profile');

      assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 2);

      profile.destroyRecord().then(function() {
        assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 1);
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let profile = make('profile');

      let deleteMock = mockDelete(profile).fails();

      profile.destroyRecord()
             .catch(() => assert.ok(true, 'delete failed the first time'))
             .then(() => {
               deleteMock.succeeds();

               profile.destroyRecord().then(function() {
                 assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 0);
                 done();
               });
             });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let profiles = makeList('profile', 2);
      let profile = profiles[0];
      mockDelete('profile');

      assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 2);

      profile.destroyRecord().then(function() {
        assert.equal(FactoryGuy.store.peekAll('profile').get('content.length'), 1);
        done();
      });
    });
  });