Skip to content

Releases: adopted-ember-addons/ember-data-factory-guy

v2.11.4

01 Feb 23:26
Compare
Choose a tag to compare
  • fixed issues relating to makeNew - #269 ( where longer attributes, camelCase were not working )

v2.11.3

29 Jan 20:37
Compare
Choose a tag to compare

-fixed to correctly recognize the new environment settings for factoryGuy:

   //=> file: config/environment.js

   if (environment === 'development') {
     ENV.factoryGuy = { useScenarios: true };
     ...
  }
  • fixed long standing issue where component unit tests were blowing up if you were using modelFragments
    • changed to detect fragments during fixture build time ( super lazy in other words )

v2.11.1

24 Jan 02:36
Compare
Choose a tag to compare
  • Adds makeNew function to list of FactoryGuy methods that Scenario class proxies

v2.11.0

23 Jan 01:11
Compare
Choose a tag to compare
  • bumped to ember-data 2.11
  • Fixed urlForQueryRecord, urlForQuery to receive the query params in the mockQuery/mockQueryRequest

NOTE: A few breaking changes are in this release

1 - mockCreate and mockUpdate now require attrs key

  • is more consistent with how the GET request mocks work

    Where you used to do this:

  mockCreate('user').returns({name: 'Flip'});
  mockUpdate('user').returns({name: 'Flip'});

Now do this:

  mockCreate('user').returns({attrs: {name: 'Flip'}});
  mockUpdate('user').returns(attrs: {name: 'Flip'}});

2 - The factory guy settings in the environment file changed

Where you used to do this:

 ENV.factoryGuy = true;

Now you do this:

  // file config/envrionment.js
  ENV.factoryGuy = {useScenarios: true};
  // or  
  ENV.factoryGuy = {enabled: false};

The default for test/development environment is:

  ENV.factoryGuy = {enabled: true, useScenarios: false};

The default for production environment is:

  ENV.factoryGuy = {enabled: false, useScenarios: false};

NOTE: If you set useScenarios: true enabled is automatically true

v2.10.1

23 Jan 01:01
Compare
Choose a tag to compare
  • fixed so tests can be run in development mode
  • fixed drf adapter not loading in fixture builder factory
  • Can now make new records as if you were doing store.createRecord(modelName, attributes)
    • use the new makeNew() function
    • api is same as make or build

Usage:

  let newCat = makeNew('cat', 'calico', {name: 'Meow'});
  newCat.get('isNew'); //=> true

v2.10.0

10 Jan 11:28
Compare
Choose a tag to compare
  • use assert rather than warning for invalid traits - #266
    • this is breaking change as it will force you to fix these mistakes
  • remove dependency on urijs package ( used for checking uri )
  • update ember-data to 2.10.0

v2.9.8

13 Dec 20:17
Compare
Choose a tag to compare

Can now pass in function for match argument in mockCreate/mockUpdate #263

v2.9.7

30 Nov 15:21
Compare
Choose a tag to compare

-once and for all fixes => #247 ( not really that confident, but let me know )

v2.9.5

29 Nov 18:28
Compare
Choose a tag to compare
  • fluffing the pillows

v2.9.4

29 Nov 18:03
Compare
Choose a tag to compare
  • fixes issue #261 with ember2.10 and overriding keyForAttribute / keyForRelationship that calls this._super