{"action":"closed","issue":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/309","labels_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/309/labels{/name}","comments_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/309/comments","events_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/309/events","html_url":"https://github.com/samselikoff/ember-cli-mirage/issues/309","id":111228649,"number":309,"title":"PUT request shorthand problem in 0.1.9 ","user":{"login":"Arkham","id":62895,"avatar_url":"https://avatars.githubusercontent.com/u/62895?v=3","gravatar_id":"","url":"https://api.github.com/users/Arkham","html_url":"https://github.com/Arkham","followers_url":"https://api.github.com/users/Arkham/followers","following_url":"https://api.github.com/users/Arkham/following{/other_user}","gists_url":"https://api.github.com/users/Arkham/gists{/gist_id}","starred_url":"https://api.github.com/users/Arkham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arkham/subscriptions","organizations_url":"https://api.github.com/users/Arkham/orgs","repos_url":"https://api.github.com/users/Arkham/repos","events_url":"https://api.github.com/users/Arkham/events{/privacy}","received_events_url":"https://api.github.com/users/Arkham/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-13T17:25:43Z","updated_at":"2015-10-13T18:25:01Z","closed_at":"2015-10-13T18:25:01Z","body":"Hey there, first of all thanks for this awesome addon, it completely changed for the better how we do integration testing in our ember apps :)\r\n\r\nI just upgraded it from 0.1.8 to 0.1.9 and enabling the console in chrome while running the tests showed me a lot of these errors:\r\n\r\n```\r\nMirage: The route handler for /swordfish/labels/1 is trying to insert data into the 1s collection, but that collection doesn't exist. To create it, create an empty fixture file or factory.console.(anonymous function) @ testem.js:721handleStringShorthand @ post.js:38handleUndefinedShorthand @ post.js:67handle @ base.js:30_getMirageResponseForRequest @ route-handler.js:68handle @ route-handler.js:40(anonymous function) @ server.js:214handleRequest @ pretender.js:270send @ pretender.js:125send @ jquery.js:9631jQuery.extend.ajax @ jquery.js:9176(anonymous function) @ rest-adapter.js:764initializePromise @ ember.debug.js:51356Promise @ ember.debug.js:52949ember$data$lib$system$adapter$$default.extend.ajax @ rest-adapter.js:729ember$data$lib$system$adapter$$default.extend.updateRecord @ rest-adapter.js:544ember$data$lib$system$store$$_commit @ store.js:1919(anonymous function) @ store.js:1218ember$data$lib$system$store$$Service.extend.flushPendingSave @ store.js:1201Queue.invokeWithOnError @ ember.debug.js:1031Queue.flush @ ember.debug.js:1086DeferredActionQueues.flush @ ember.debug.js:887Backburner.end @ ember.debug.js:176Backburner.run @ ember.debug.js:289run @ ember.debug.js:19661actions.push.handler @ ember.debug.js:22558(anonymous function) @ ember.debug.js:41042jQuery.event.dispatch @ jquery.js:4641elemData.handle @ jquery.js:4309jQuery.event.trigger @ jquery.js:4550(anonymous function) @ jquery.js:5260jQuery.extend.each @ jquery.js:383jQuery.fn.jQuery.each @ jquery.js:136jQuery.fn.extend.trigger @ jquery.js:5259jQuery.fn.(anonymous function) @ jquery.js:8443Backburner.run @ ember.debug.js:283run @ ember.debug.js:19661click @ ember.debug.js:37785(anonymous function) @ ember.debug.js:38621isolate @ ember.debug.js:38822(anonymous function) @ ember.debug.js:38806tryCatch @ ember.debug.js:51306invokeCallback @ ember.debug.js:51321publish @ ember.debug.js:51289(anonymous function) @ ember.debug.js:29939Queue.invokeWithOnError @ ember.debug.js:1031Queue.flush @ ember.debug.js:1086DeferredActionQueues.flush @ ember.debug.js:887Backburner.end @ ember.debug.js:176Backburner.run @ ember.debug.js:289run @ ember.debug.js:19661(anonymous function) @ ember.debug.js:37940\r\ntestem.js:721 Mirage: Your handler for the url /swordfish/labels/1 threw an error: Cannot read property 'insert' of undefined TypeError: Cannot read property 'insert' of undefined\r\n    at PostShorthandRouteHandler.handleStringShorthand (http://localhost:7357/assets/vendor.js:165477:37)\r\n    at PostShorthandRouteHandler.handleUndefinedShorthand (http://localhost:7357/assets/vendor.js:165503:21)\r\n    at PostShorthandRouteHandler.handle (http://localhost:7357/assets/vendor.js:165047:33)\r\n    at RouteHandler._getMirageResponseForRequest (http://localhost:7357/assets/vendor.js:164864:30)\r\n    at RouteHandler.handle (http://localhost:7357/assets/vendor.js:164836:35)\r\n    at Object.handler (http://localhost:7357/assets/vendor.js:166235:43)\r\n    at Object.handleRequest (http://localhost:7357/assets/vendor.js:89179:44)\r\n    at Object.send (http://localhost:7357/assets/vendor.js:89034:17)\r\n    at Object.send (http://localhost:7357/assets/vendor.js:9840:10)\r\n    at Function.jQuery.extend.ajax (http://localhost:7357/assets/vendor.js:9385:15)\r\n```\r\n\r\nRight now in my mirage config I have it configured using shorthands:\r\n\r\n```js\r\nimport Ember from 'ember';\r\n\r\nexport default function() {\r\n  this.namespace = '/swordfish';\r\n\r\n  this.get('/labels');\r\n  this.post('/labels');\r\n  this.put('/labels/:id');\r\n  this.delete('/labels/:id');\r\n};\r\n```\r\n\r\nI checked the documentation ( http://www.ember-cli-mirage.com/docs/v0.1.x/shorthands/#put-shorthands ) but if I change it to `this.put('/labels')` it still blows up with this message\r\n\r\n```\r\nMirage: Your Ember app tried to PUT '/swordfish/labels/1', but there was no route defined to handle this request. Define a route that matches this path in your mirage/config.js file. Did you forget to add your namespace?console.(anonymous function) @ testem.js:721Server.pretender.interceptor.Pretender.default.unhandledRequest @ server.js:41handleRequest @ pretender.js:286send @ pretender.js:125jQuery.ajaxTransport.options.send @ jquery.js:9631jQuery.extend.ajax @ jquery.js:9176ember$data$lib$system$adapter$$default.extend.ajax @ rest-adapter.js:764initializePromise @ ember.debug.js:51356Promise @ ember.debug.js:52949ember$data$lib$system$adapter$$default.extend.ajax @ rest-adapter.js:729ember$data$lib$system$adapter$$default.extend.updateRecord @ rest-adapter.js:544ember$data$lib$system$store$$_commit @ store.js:1919(anonymous function) @ store.js:1218ember$data$lib$system$store$$Service.extend.flushPendingSave @ store.js:1201Queue.invokeWithOnError @ ember.debug.js:1031Queue.flush @ ember.debug.js:1086DeferredActionQueues.flush @ ember.debug.js:887Backburner.end @ ember.debug.js:176Backburner.run @ ember.debug.js:289run @ ember.debug.js:19661ActionHelper.registerAction.actions.push.handler @ ember.debug.js:22558(anonymous function) @ ember.debug.js:41042jQuery.event.dispatch @ jquery.js:4641jQuery.event.add.elemData.handle @ jquery.js:4309jQuery.event.trigger @ jquery.js:4550(anonymous function) @ jquery.js:5260jQuery.extend.each @ jquery.js:383jQuery.fn.jQuery.each @ jquery.js:136jQuery.fn.extend.trigger @ jquery.js:5259jQuery.each.jQuery.fn.(anonymous function) @ jquery.js:8443Backburner.run @ ember.debug.js:283run @ ember.debug.js:19661click @ ember.debug.js:37785(anonymous function) @ ember.debug.js:38621isolate @ ember.debug.js:38822(anonymous function) @ ember.debug.js:38806tryCatch @ ember.debug.js:51306invokeCallback @ ember.debug.js:51321publish @ ember.debug.js:51289(anonymous function) @ ember.debug.js:29939Queue.invokeWithOnError @ ember.debug.js:1031Queue.flush @ ember.debug.js:1086DeferredActionQueues.flush @ ember.debug.js:887Backburner.end @ ember.debug.js:176Backburner.run @ ember.debug.js:289run @ ember.debug.js:19661(anonymous function) @ ember.debug.js:37940\r\nlog-error.js:7 Error: Assertion Failed: You can only unload a record which is not inFlight. `<phoenix@model:label::ember32479:1>`\r\n    at new Error (native)\r\n    at Error.EmberError (http://localhost:7357/assets/vendor.js:25840:21)\r\n    at assert (http://localhost:7357/assets/vendor.js:15741:13)\r\n    at Object.assert (http://localhost:7357/assets/vendor.js:23142:34)\r\n    at Object.ember$data$lib$system$model$states$$assertAgainstUnloadRecord [as unloadRecord] (http://localhost:7357/assets/vendor.js:141603:13)\r\n    at ember$data$lib$system$model$internal$model$$InternalModel.send (http://localhost:7357/assets/vendor.js:143450:34)\r\n    at ember$data$lib$system$model$internal$model$$InternalModel.unloadRecord (http://localhost:7357/assets/vendor.js:143328:14)\r\n    at ember$data$lib$system$store$$Service.extend.unloadAll (http://localhost:7357/assets/vendor.js:144878:20)\r\n    at Array.forEach (native)\r\n    at ember$data$lib$system$store$$Service.extend.unloadAll (http://localhost:7357/assets/vendor.js:144869:17)\r\n```\r\n\r\nThanks again!"}}