{"action":"opened","issue":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/169","labels_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/169/comments","events_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/169/events","html_url":"https://github.com/samselikoff/ember-cli-mirage/issues/169","id":87865761,"number":169,"title":"Ember-CLI-Mirage: Test a list of objects for belongsTo object's property value","user":{"login":"sbsurf","id":803818,"avatar_url":"https://avatars.githubusercontent.com/u/803818?v=3","gravatar_id":"","url":"https://api.github.com/users/sbsurf","html_url":"https://github.com/sbsurf","followers_url":"https://api.github.com/users/sbsurf/followers","following_url":"https://api.github.com/users/sbsurf/following{/other_user}","gists_url":"https://api.github.com/users/sbsurf/gists{/gist_id}","starred_url":"https://api.github.com/users/sbsurf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbsurf/subscriptions","organizations_url":"https://api.github.com/users/sbsurf/orgs","repos_url":"https://api.github.com/users/sbsurf/repos","events_url":"https://api.github.com/users/sbsurf/events{/privacy}","received_events_url":"https://api.github.com/users/sbsurf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-12T22:17:50Z","updated_at":"2015-06-12T22:17:50Z","closed_at":null,"body":"A Patient `belongsTo` an Account. I have a page which displays a list of patients, one of the columns being their account's name.\r\n\r\nIf I need to go to `/patients` and test that a list of patients with their account's name are listed, how do I do it? Documentation talks about going to `/accounts/:id` and testing for the account's list of patients, but not the other way around.\r\n\r\nBasically, I want to test that an element with the value of `patients[0].account.name` exists on the page.\r\n\r\nTo set this up, I have tried things like:\r\n\r\n    const account = server.create('account'),\r\n         patients = server.createList('patient', 2, account_id = account.id);\r\n\r\nAnd\r\n\r\n    const account = server.create('account'),\r\n         patients = server.createList('patient', 2, account = account);\r\n\r\nAnd\r\n\r\n    const patients = server.createList('patient', 2, account = {id: 1, name: 'blah'});\r\n\r\nAll of which seem to make the test fail or time out.\r\n\r\nAlso, I don't understand why I can't just set a property on my `patient` object to equal a POJO, as I try to do in my last example.\r\n\r\n\r\nI also posted this on SO, in case you'd like to answer it there: http://stackoverflow.com/q/30812897/1042380\r\n\r\nThanks!"}}