message: test coverage for writers change events
diff: @@ -99,6 +99,18 @@ describe('git/writer', function() {
  });
  });
  + it('emits changed event', async function () {
  + let log = [];
  + writers.on('changed', message => log.push(message));
  + await writers.create('master', user, 'articles', {
  + type: 'articles',
  + attributes: {
  + title: 'Second Article'
  + }
  + });
  + expect(log).length(1);
  + });
  +
  it('saves default attribute', async function() {
  await writers.create('master', user, 'things-with-defaults', {
  @@ -387,6 +399,23 @@ describe('git/writer', function() {
  expect(record).has.deep.property('meta.version').not.equal(env.head);
  });
  +
  + it('emits changed event', async function() {
  + let log = [];
  + writers.on('changed', message => log.push(message));
  + await writers.update('master', user, 'articles', '1', {
  + id: '1',
  + type: 'articles',
  + attributes: {
  + title: 'Updated title'
  + },
  + meta: {
  + version: env.head
  + }
  + });
  + expect(log).length(1);
  + });
  +
  it('returns unchanged field', async function() {
  let record = await writers.update('master', user, 'people', '1', {
  id: '1',
  @@ -598,6 +627,13 @@ describe('git/writer', function() {
  expect(articles).to.not.contain('1.json');
  });
  + it('emits changed event', async function() {
  + let log = [];
  + writers.on('changed', message => log.push(message));
  + await writers.delete('master', user, env.head, 'people', '1');
  + expect(log).length(1);
  + });
  +
  it('reports merge conflict', async function() {
  await writers.update('master', user, 'articles', '1', {
  id: '1',
  