How to use the ember-data-factory-guy.makeNew 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-factory-guy-behaviour.js View on Github external
test("handles hasMany relationships", function(assert) {
    let projects = makeList('project', 1),
        user     = makeNew('user', {projects});
    assert.deepEqual(user.get('projects').toArray(), projects.toArray(), 'hasMany projects');
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-factory-guy-behaviour.js View on Github external
test("handles belongsTo relationships", function(assert) {
    let company = make('company'),
        profile = makeNew('profile', {company});
    assert.equal(profile.get('company'), company, 'belongsTo company');
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(async () => {
      let description          = "special description",
          camelCaseDescription = "special camelcase description",
          profile              = makeNew('profile', {description, camelCaseDescription});

      mockCreate(profile).match({camelCaseDescription, description});
      await profile.save();

      assert.ok(!profile.get('isNew'), 'Profile is saved');
      assert.deepEqual(
        profile.getProperties(['description', 'camelCaseDescription']),
        {camelCaseDescription, description},
        'correct model attributes present'
      );
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(async () => {
      let description          = "special description",
          camelCaseDescription = "special camelcase description",
          profile              = makeNew('profile', {description, camelCaseDescription});

      mockCreate(profile).match({camelCaseDescription, description});
      await profile.save();

      assert.ok(!profile.get('isNew'), 'Profile is saved');
      assert.deepEqual(
        profile.getProperties(['description', 'camelCaseDescription']),
        {camelCaseDescription, description},
        'correct model attributes present'
      );
    });
  });