substance / notes

Real-time collaborative notes editing.
Other
21 stars 5 forks source link

Implement new seeding API #46

Closed michael closed 8 years ago

michael commented 8 years ago

We needed a modular backend seeding strategy for testing. Seeds can be specified as JSON and look like this:

// substance/test/fixtures/collab/backendSeed.js
var twoParagraphs = require('./two-paragraphs');
var testSeed = {
  users: {
    'test': {
      userId: 'test',
      name: 'Test user',
      loginKey: '1234'      
    }
  },
  changesets: {
    'test-doc': twoParagraphs.createChangeset()
  }
};

Backend provides a method seed which is used during testing and in seed.js.

Setup: Check out the backend-tests branch of the Notes app and npm link substance which is at branch collab-improvements.

Your first task is to make the initial seeding work again using the new API.

node seed.js

Implementation should go here: https://github.com/substance/notes/blob/backend-tests/server/Backend.js#L337-L351

You may also need to touch: https://github.com/substance/notes/blob/backend-tests/seed.js

More tasks are coming soon.

michael commented 8 years ago

Oh and pls work on a branch and make PR into backend-tests.

Integral commented 8 years ago

I did ignore userId from your fixture as it is incremental thing.

michael commented 8 years ago

That's done.