{"action":"created","issue":{"url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/212","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/212/labels{/name}","comments_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/212/comments","events_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/212/events","html_url":"https://github.com/danielspaniel/ember-data-factory-guy/pull/212","id":161816802,"number":212,"title":"Added failing test for `returns` with mockCreate","user":{"login":"patocallaghan","id":685034,"avatar_url":"https://avatars.githubusercontent.com/u/685034?v=3","gravatar_id":"","url":"https://api.github.com/users/patocallaghan","html_url":"https://github.com/patocallaghan","followers_url":"https://api.github.com/users/patocallaghan/followers","following_url":"https://api.github.com/users/patocallaghan/following{/other_user}","gists_url":"https://api.github.com/users/patocallaghan/gists{/gist_id}","starred_url":"https://api.github.com/users/patocallaghan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patocallaghan/subscriptions","organizations_url":"https://api.github.com/users/patocallaghan/orgs","repos_url":"https://api.github.com/users/patocallaghan/repos","events_url":"https://api.github.com/users/patocallaghan/events{/privacy}","received_events_url":"https://api.github.com/users/patocallaghan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-23T00:37:44Z","updated_at":"2016-06-23T00:56:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/pulls/212","html_url":"https://github.com/danielspaniel/ember-data-factory-guy/pull/212","diff_url":"https://github.com/danielspaniel/ember-data-factory-guy/pull/212.diff","patch_url":"https://github.com/danielspaniel/ember-data-factory-guy/pull/212.patch"},"body":"I'm seeing some weird behaviour with `returns` not working but not sure if it's because I'm doing something wrong.\r\n\r\nEssentially in the acceptance test I do:\r\n\r\n``` js\r\nlet project = make('project'); //project record has id 1\r\nmockCreate('project').match({title: newProjectTitle}).returns({model: project})\r\n```\r\n\r\nyet in the application code that calls `createRecord` the record is a newly created one and not the one from the `returns`\r\n\r\n``` js\r\nthis.get('store').createRecord('project', {title: title, user: user}).save()\r\n.then((record) => {\r\n  // project record has id 2\r\n});\r\n```\r\n\r\nThe consequence of this is that the `record.reload()` fails due to `mockReload` being passed the wrong record id in the test.\r\n\r\nAm I doing something wrong here or is this a bug?"},"comment":{"url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/comments/227920915","html_url":"https://github.com/danielspaniel/ember-data-factory-guy/pull/212#issuecomment-227920915","issue_url":"https://api.github.com/repos/danielspaniel/ember-data-factory-guy/issues/212","id":227920915,"user":{"login":"patocallaghan","id":685034,"avatar_url":"https://avatars.githubusercontent.com/u/685034?v=3","gravatar_id":"","url":"https://api.github.com/users/patocallaghan","html_url":"https://github.com/patocallaghan","followers_url":"https://api.github.com/users/patocallaghan/followers","following_url":"https://api.github.com/users/patocallaghan/following{/other_user}","gists_url":"https://api.github.com/users/patocallaghan/gists{/gist_id}","starred_url":"https://api.github.com/users/patocallaghan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patocallaghan/subscriptions","organizations_url":"https://api.github.com/users/patocallaghan/orgs","repos_url":"https://api.github.com/users/patocallaghan/repos","events_url":"https://api.github.com/users/patocallaghan/events{/privacy}","received_events_url":"https://api.github.com/users/patocallaghan/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T00:56:25Z","updated_at":"2016-06-23T00:56:25Z","body":"I *think* I understand.\r\n\r\nAre you saying that the API for `mockCreate` doesn't support the `.returns({model: user})` or `.returns({json: user})` syntax? Only the GET requests like `mockQuery` and `findRecord` support it?"}}
{"actor":{"display_login":"patocallaghan"}}