import fixture from 'can-fixture';

var accountFixtureData = [{
  _id: 1,
  name: 'Checking',
  balance: 1000.55
}, {
  _id: 2,
  name: 'Savings',
  balance: 40.33
}, {
  _id: 3,
  name: 'Kids Savings',
  balance: 95000.01
}];

export default accountFixtureData;

fixture({url: "/v1/accounts", method: "get"}, function(request, response){
  response(accountFixtureData);
});

fixture({url: "/v1/accounts/{id}", method: "get"}, function(request, response){
  response(accountFixtureData[0]);
});

fixture({url: "/v1/accounts/{id}", method: "patch"}, function(request, response){
  var id = request.data.id;
  var temp = Object.assign({}, request.data);
  delete temp.id;
  response(Object.assign(accountFixtureData[id - 1], request.data));
});

fixture({url: "/v1/accounts", method: "post"}, function(request, response){
  request.data._id = 1;
  response(request.data);
});

fixture({url: "/v1/accounts/{id}", method: "delete"}, function(request, response){
  response(accountFixtureData[0]);
});

@@ -481,32 +481,143 @@
 eData%5B0%5D);%0A%7D);%0A%0A
+fixture(%7Burl: %22/v1/accounts/%7Bid%7D%22, method: %22put%22%7D, function(request, response)%7B%0A  response(request.data);%0A%7D);%0A%0A
 fixture(%7Burl: %22/

Fix fixture for save/put.