{"action":"created","issue":{"url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/210","repository_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy","labels_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/210/comments","events_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/210/events","html_url":"https://github.com/danielspaniel/ember-data-factory-guy/issues/210","id":160692042,"number":210,"title":"Make vs build, debugging mockjax requests","user":{"login":"brancusi","id":71524,"avatar_url":"https://avatars.githubusercontent.com/u/71524?v=3","gravatar_id":"","url":"https://api.github.com/users/brancusi","html_url":"https://github.com/brancusi","followers_url":"https://api.github.com/users/brancusi/followers","following_url":"https://api.github.com/users/brancusi/following{/other_user}","gists_url":"https://api.github.com/users/brancusi/gists{/gist_id}","starred_url":"https://api.github.com/users/brancusi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brancusi/subscriptions","organizations_url":"https://api.github.com/users/brancusi/orgs","repos_url":"https://api.github.com/users/brancusi/repos","events_url":"https://api.github.com/users/brancusi/events{/privacy}","received_events_url":"https://api.github.com/users/brancusi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-06-16T15:34:40Z","updated_at":"2016-06-17T15:56:35Z","closed_at":null,"body":"Hi,\r\n\r\nWhen trying to `mockFindAll` records with associated models, I can't seem to use `make` or `makeList`. The resulting response from these don't seem to load the relationships even though I can inspect and see that there are relationships.\r\n\r\nExample:\r\n\r\n```js\r\nconst post = make('post', 'with_comments');\r\ndebugger;\r\n```\r\n\r\nIf I inspect this, I can do:\r\n\r\n```js\r\npost.get('comments.firstObject.id');\r\n```\r\n\r\nand it shows `1`\r\n\r\nBut in the acceptance test, when using `mockFindAll('post')`, that post doesn't have any comments in the app.\r\n\r\nIf on the other hand I use:\r\n\r\n```js\r\nconst post = build('post', 'with_comments')\r\nmockFindAll('post').returns({json:post});\r\n```\r\n\r\nThe comments are there.\r\n\r\nThe issue is I then can't get `mockUpdate` to work.\r\n\r\n```js\r\nmockUpdate('post', 1);\r\n```\r\n\r\nResults in a 404\r\n\r\nObviously I am doing something goofy since this is really basic stuff and no one else seems to be having these issues.\r\n\r\nWondering if there is a to debug mockjax to see what the response will be. Also, would it be possible to add an example acceptance test that includes these steps:\r\n\r\n1. `buildList` of records\r\n1. `mockQuery` those records\r\n1. `mockUpdate` the first record\r\n\r\nI think I would answer my own question once seeing a working version of those steps in a single test.\r\n\r\nThank you again for the great project\r\n\r\nJust in case the actual code reveals something useful:\r\n\r\n```js\r\ntest('can delete individual route visit', async function(assert) {\r\n  const routePlan = make('route-plan');\r\n  const routeVisits = buildList('route-visit', 2, {routePlan});\r\n\r\n  mockFindAll('route-visit').returns({json:routeVisits});\r\n  mockQuery('route-visit').returns({json:routeVisits});\r\n\r\n  await page.visit();\r\n  assert.equal(page.routePlans(0).routeVisits().count, 2);\r\n\r\n  mockUpdate('route-visit', 1);\r\n\r\n  await page.routePlans(0).routeVisits(0).delete();\r\n  assert.equal(page.routePlans(0).routeVisits().count, 1);\r\n});\r\n```\r\n\r\nResults with: `Error: Ember Data Request PUT /route-visits/1 returned a 404`\r\n\r\n*Using mockUpdate even though it looks like I need a delete, removing is just updating the parent association, hence using mockUpdate*"},"comment":{"url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/comments/226808331","html_url":"https://github.com/danielspaniel/ember-data-factory-guy/issues/210#issuecomment-226808331","issue_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/210","id":226808331,"user":{"login":"brancusi","id":71524,"avatar_url":"https://avatars.githubusercontent.com/u/71524?v=3","gravatar_id":"","url":"https://api.github.com/users/brancusi","html_url":"https://github.com/brancusi","followers_url":"https://api.github.com/users/brancusi/followers","following_url":"https://api.github.com/users/brancusi/following{/other_user}","gists_url":"https://api.github.com/users/brancusi/gists{/gist_id}","starred_url":"https://api.github.com/users/brancusi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brancusi/subscriptions","organizations_url":"https://api.github.com/users/brancusi/orgs","repos_url":"https://api.github.com/users/brancusi/repos","events_url":"https://api.github.com/users/brancusi/events{/privacy}","received_events_url":"https://api.github.com/users/brancusi/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T15:56:35Z","updated_at":"2016-06-17T15:56:35Z","body":"Sure here is the repo: https://github.com/brancusi/last-strawberry\r\n\r\nCheckout: https://github.com/brancusi/last-strawberry/blob/master/tests/acceptance/distribution-test.js\r\nAnd the route: https://github.com/brancusi/last-strawberry/blob/master/app/routes/distribution.js"}}
{"actor":{"display_login":"brancusi"}}