Skip to content

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

v2.3.2

03 Mar 00:45
Compare
Choose a tag to compare
  • Fixed mockFindAll('user') to work as expected ( return no models )

v2.3.1

03 Mar 00:45
Compare
Choose a tag to compare
  • fixed makeList('user', 3) to work as expected #177

v2.3.0

02 Mar 13:07
Compare
Choose a tag to compare
  • Massive overhaul of mock GET request Handlers
    • renamed andReturns() method to returns()
    • Now have consistent returns() method for each one
      • taking models, model, json, ids, id, or headers as options
    • deprecated returnsJSON, returnsModels, returnsIds
    • deprecated handle names for mock names
    • Added mockQueryRecord
    • Many of the ideas inspired by @xcambar from ideas in #157, #158, #159
  • renamed andFails to fails
  • can now import mockFind, mockFindAll ... etc methods from 'ember-data-factory-guy' top level import
  • use get() method to unwrap json make with build, buildList
    • used to be called unwrap()
    • More big thanks to @migbar for the help on this featuer
  • can now get access to mock handler being used by mockjax from mock object

READ the new documentation .. so much has changed, hard to list it all:

Biggest changes here:

v2.2.0

19 Feb 13:00
Compare
Choose a tag to compare
  • Minor version bump, but major feature added
  • You can now compose json when building associations in build method
    • This looks like:
import FactoryGuy, { build } from 'ember-data-factory-guy';

let user = build('user');
let project = build('project', {user: user});
  • The project will have the user association and it will be all ready to side load it
    when used with the factory guy helper 'handleQuery'
import fgHelper from 'ember-data-factory-guy/factory-guy-test-helper';

let user = build('user');
let project = build('project', {user: user});
fgHelper.handleQuery('project').returnsJSON(project);
  • you can access the properties of user or project with call to 'unwrap'
import FactoryGuy, { build } from 'ember-data-factory-guy';

let user = build('user');
let project = build('project', {user: user});

user.unwrap().id //=> returns 1 or whatever the user id is
  • Will soon be adding the ability to pass custom built json to the other test helpers
    • handleFind
    • handleFindAll
  • Big thanks to @migbar for the inspiration and ideas

v2.1.6

14 Feb 19:16
Compare
Choose a tag to compare
  • added FactoryGuy.cacheOnlyMode
    • for tests when you want to put models in the store and never go to server to fetch models.
    • sets false on all shouldReload callbacks in every adapter
    • allows for easier scenario building

v2.1.5

14 Feb 19:17
Compare
Choose a tag to compare
  • added ability to use id's as numbers when building has many relationships #166

v2.1.4

23 Jan 23:24
Compare
Choose a tag to compare
  • new manualSetup method for setting up FactoryGuy when there is no application loaded, and only a container
    • need to use moduleFor helpers for this to work
    • need to be on ember 2.3 to use it ( or install ember-getowner-pollyfill addon )
    • issue #171
  • building json now correctly handles custom attribute transformations #173

v2.1.3

16 Dec 18:22
Compare
Choose a tag to compare

Production build not longer includes FactoryGuy #140, #163
TestHelper.handleFindAll can now accept a list of options so you can create different models instead of many of the same ones #161
Starting to deprecate use of non chained methods in handle calls #162

v2.1.2

05 Dec 00:36
Compare
Choose a tag to compare

Fixed handleQuery bugs #151
Can now use withParams feature on a handleQuery object #151
Now able to inject your own fixture builder #152
No longer using FactoryGuy.getStore() #153

v2.1.1

02 Nov 00:16
Compare
Choose a tag to compare

removed handleFindQuery method from TestHelpers ( it's been deprecated for a while )

For issues ( #143, #139 )
added these methods to handleQuery:

returnsJSON .. json from buildList
returnsModels .. array of models
returnsExistingIds .. array of ids of models that exist

Also, better handling of boolean attributes #145