How to use the ember-data-factory-guy.mockReload 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 mock = mockReload('profile', 1).fails();

      FactoryGuy.store.findRecord('profile', 1)
                .catch(() => {
                    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 profile = make('profile', {description: "whatever", camelCaseDescription: "noodles"});

      mockReload(profile).returns({attrs: {description: "moo"}});

      profile.reload().then(function(reloaded) {
        assert.ok(reloaded.id === profile.id, 'does not change id');
        assert.ok(reloaded.get('description') === "moo", "attribute changed");
        assert.ok(reloaded.get('camelCaseDescription') === "noodles", "other attributes are same");
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      let mock = mockReload('profile', 1).fails();

      FactoryGuy.store.findRecord('profile', 1)
                .catch(() => {
                    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 profile = make('profile', {description: "tomatoes", camelCaseDescription: "noodles"});

      let newProfile = build('profile', {id: profile.get('id'), description: "potatoes", camelCaseDescription: "poodles"});
      mockReload(profile).returns({json: newProfile});

      profile.reload().then(function(reloaded) {
        assert.ok(reloaded.id === profile.id, 'does not change id');
        assert.ok(reloaded.get('description') === "potatoes", "description changed");
        assert.ok(reloaded.get('camelCaseDescription') === "poodles", "camelCaseDescription changes");
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let profile = make('profile', {description: "whatever"});
      mockReload(profile);

      profile.reload().then(function(reloaded) {
        assert.ok(reloaded.id === profile.id);
        assert.ok(reloaded.get('description') === profile.get('description'));
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let profile = make('profile', {description: "whatever"});
      mockReload(profile);

      profile.reload().then(function(reloaded) {
        assert.ok(reloaded.id === profile.id);
        assert.ok(reloaded.get('description') === profile.get('description'));
        done();
      });
    });
  });