message: reorganize ephemeral-test
diff: @@ -15,7 +15,7 @@ const JSONAPIFactory = require('../../../tests/ephemeral-test-app/node_modules/@
  describe('ephemeral-storage', function() {
  let env, request;
  - beforeEach(async function() {
  + async function setup() {
  let factory = new JSONAPIFactory();
  let initial = new JSONAPIFactory();
  initial.addResource('posts', 'initial').withAttributes({ title: 'initial post' });
  @@ -58,17 +58,27 @@ describe('ephemeral-storage', function() {
  let app = new Koa();
  app.use(env.lookup('hub:middleware-stack').middleware());
  request = supertest(app.callback());
  - });
  + }
  - afterEach(async function() {
  + async function teardown() {
  await destroyDefaultEnvironment(env);
  - });
  + }
  +
  + describe('read-only', function() {
  + before(setup);
  + after(teardown);
  it('respects params.initialModels', async function() {
  let response = await request.get(`/api/posts/initial`);
  expect(response).hasStatus(200);
  expect(response.body).has.deep.property('data.attributes.title', 'initial post');
  });
  + });
  +
  + describe('read-write', function() {
  + beforeEach(setup);
  + afterEach(teardown);
  +
  it('respect schema in params.initialModels', async function() {
  let response = await request.post(`/api/extra-things`).send({
  @@ -283,12 +293,12 @@ describe('ephemeral-storage', function() {
  response = await request.get('/api/posts/first-post');
  expect(response).hasStatus(404);
  });
  -
  });
  -describe('ephemeral-storage/invalid', function() {
  - it.skip('rejects schema violations in initial models', async function() {
  + describe('invalid', function() {
  +
  + it('rejects schema violations in initial models', async function() {
  let initial = new JSONAPIFactory();
  initial.addResource('no-such-types').withAttributes({ title: 'initial post' });
  @@ -308,6 +318,7 @@ describe('ephemeral-storage/invalid', function() {
  expect(err.message).to.equal('"no-such-types" is not a writable type');
  }
  });
  + });
  });
  