{"action":"created","issue":{"url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/85","labels_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/85/comments","events_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/85/events","html_url":"https://github.com/offirgolan/ember-cp-validations/issues/85","id":120738903,"number":85,"title":"checking an arbitrary (Ember.)Object while in a test","user":{"login":"lindem","id":1142311,"avatar_url":"https://avatars.githubusercontent.com/u/1142311?v=3","gravatar_id":"","url":"https://api.github.com/users/lindem","html_url":"https://github.com/lindem","followers_url":"https://api.github.com/users/lindem/followers","following_url":"https://api.github.com/users/lindem/following{/other_user}","gists_url":"https://api.github.com/users/lindem/gists{/gist_id}","starred_url":"https://api.github.com/users/lindem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindem/subscriptions","organizations_url":"https://api.github.com/users/lindem/orgs","repos_url":"https://api.github.com/users/lindem/repos","events_url":"https://api.github.com/users/lindem/events{/privacy}","received_events_url":"https://api.github.com/users/lindem/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-07T10:08:17Z","updated_at":"2015-12-07T10:46:35Z","closed_at":"2015-12-07T10:46:35Z","body":"I am trying to do some custom validation for objects pulled in while the test environment runs (ember-qunit). It's built like this: \r\n\r\n````javascript\r\nmodule('test arbitrary object', {\r\n  this.application = startApp();\r\n  this.container = this.application.__container__;\r\n});\r\n\r\ntest('it works', function(assert) {\r\n  // make a validation mixin\r\n  const Validations = buildValidations({\r\n    a: [validator('presence', true)]\r\n  });\r\n  /* theObject usually comes from somewhere else, this is just for illustration */\r\n  const theObject = Ember.Object.extend(Validations, {\r\n    a: 5\r\n  }).create();\r\n  // validate, check, whatever\r\n});\r\n````\r\n\r\nI still get  `<(unknown mixin):ember230> is missing a container.` and don't know how to properly pass in the container in this case (but I do have one, it's in `this.container` in the test function scope). Is it at all possible? "},"comment":{"url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/comments/162480372","html_url":"https://github.com/offirgolan/ember-cp-validations/issues/85#issuecomment-162480372","issue_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/85","id":162480372,"user":{"login":"lindem","id":1142311,"avatar_url":"https://avatars.githubusercontent.com/u/1142311?v=3","gravatar_id":"","url":"https://api.github.com/users/lindem","html_url":"https://github.com/lindem","followers_url":"https://api.github.com/users/lindem/followers","following_url":"https://api.github.com/users/lindem/following{/other_user}","gists_url":"https://api.github.com/users/lindem/gists{/gist_id}","starred_url":"https://api.github.com/users/lindem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindem/subscriptions","organizations_url":"https://api.github.com/users/lindem/orgs","repos_url":"https://api.github.com/users/lindem/repos","events_url":"https://api.github.com/users/lindem/events{/privacy}","received_events_url":"https://api.github.com/users/lindem/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T10:46:35Z","updated_at":"2015-12-07T10:46:35Z","body":"Also, I discovered that my beforeEach somehow didn't do what I expected it to do; a working minimal example is now \r\n\r\n````javascript\r\ntest('it works', function(assert) {\r\n  const container = startApp().__container__;\r\n  const Validations = buildValidations({\r\n    a: [validator('presence', true)]\r\n  });\r\n  const theObject = Ember.Object.extend(Validations, {\r\n    a: 5,\r\n    container\r\n  }).create();\r\n  const {validations} = theObject.validateSync();\r\n  assert.strictEqual(validations.get('isValid'), true);\r\n});\r\n````"}}