Releases: adopted-ember-addons/ember-data-factory-guy
Releases · adopted-ember-addons/ember-data-factory-guy
v2.3.2
- Fixed mockFindAll('user') to work as expected ( return no models )
v2.3.1
v2.3.0
- Massive overhaul of mock GET request Handlers
- renamed
andReturns()
method toreturns()
- 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
- 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
- used to be called
- 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
- 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
- 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
v2.1.4
- 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
v2.1.2
v2.1.1
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