{"action":"opened","issue":{"url":"https://api.github.com/repos/cristinawithout/ember-cli-data-factory-guy/issues/9","labels_url":"https://api.github.com/repos/cristinawithout/ember-cli-data-factory-guy/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/cristinawithout/ember-cli-data-factory-guy/issues/9/comments","events_url":"https://api.github.com/repos/cristinawithout/ember-cli-data-factory-guy/issues/9/events","html_url":"https://github.com/cristinawithout/ember-cli-data-factory-guy/issues/9","id":64360128,"number":9,"title":"Using Fixture Adapter Conditionally","user":{"login":"ronco","id":613156,"avatar_url":"https://avatars.githubusercontent.com/u/613156?v=3","gravatar_id":"","url":"https://api.github.com/users/ronco","html_url":"https://github.com/ronco","followers_url":"https://api.github.com/users/ronco/followers","following_url":"https://api.github.com/users/ronco/following{/other_user}","gists_url":"https://api.github.com/users/ronco/gists{/gist_id}","starred_url":"https://api.github.com/users/ronco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronco/subscriptions","organizations_url":"https://api.github.com/users/ronco/orgs","repos_url":"https://api.github.com/users/ronco/repos","events_url":"https://api.github.com/users/ronco/events{/privacy}","received_events_url":"https://api.github.com/users/ronco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-25T20:01:17Z","updated_at":"2015-03-25T20:01:17Z","closed_at":null,"body":"We only want to use the fixture adapter with our acceptance tests some of the time.  The rest of the time we want to use our apps real adapter and mock the http API responses.  This worked when our app was using Globals, but converting to an ember-cli app we could no longer conditionally override it.\r\n\r\nI was able to fix this by initializing the acceptance app with a this custom resolver:\r\n\r\n```javascript\r\n// 'tests/helpers/fixture-resolver'\r\nimport Resolver from 'ember/resolver';\r\nimport DS from 'ember-data';\r\n\r\nvar FixtureResolver = Resolver.extend({\r\n  resolveOther: function(parsedName) {\r\n    if (parsedName.type !== 'adapter') {\r\n      return this._super(parsedName);\r\n    }\r\n    return DS.FixtureAdapter;\r\n  }\r\n\r\n});\r\n\r\nexport default FixtureResolver;\r\n```\r\n\r\nThen in start-app.js:\r\n```javascript\r\n  if (attributes.usingFixtures) {\r\n    attributes.Resolver = fixtureResolver;\r\n  }\r\n  Ember.run(function() {\r\n    application = Application.create(attributes);\r\n    application.setupForTesting();\r\n    application.injectTestHelpers();\r\n  });\r\n```\r\n\r\nIt would be great if this add-on provided this (or a better solution).\r\n"}}