Rough in some tests
This commit is contained in:
parent
9fa701c44e
commit
35475c2b92
6 changed files with 112 additions and 4 deletions
|
@ -24,4 +24,19 @@ export function testConfig() {
|
|||
this.post('/characteristics');
|
||||
this.get('/characteristics/:id');
|
||||
this.put('/characteristics/:id');
|
||||
|
||||
this.get('/strains', function(db /*, request*/) {
|
||||
return {
|
||||
strains: db.strains,
|
||||
species: db.species,
|
||||
};
|
||||
});
|
||||
this.post('/strains');
|
||||
this.get('/strains/:id', function(db, request) {
|
||||
return {
|
||||
strain: db.strains.find(request.params.id),
|
||||
species: db.species, // Just send back everything we've got
|
||||
}
|
||||
});
|
||||
this.put('/strains/:id');
|
||||
}
|
||||
|
|
17
app/mirage/factories/strains.js
Normal file
17
app/mirage/factories/strains.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
import Mirage, { faker } from 'ember-cli-mirage';
|
||||
|
||||
export default Mirage.Factory.extend({
|
||||
measurements: [],
|
||||
characteristics: [],
|
||||
species: 0,
|
||||
strainName() { return faker.lorem.words().join(' '); },
|
||||
typeStrain: faker.random.boolean(),
|
||||
accessionNumbers() { return faker.lorem.words().join(' '); },
|
||||
genbank() { return faker.lorem.words().join(' '); },
|
||||
wholeGenomeSequence() { return faker.lorem.words().join(' '); },
|
||||
isolatedFrom: faker.lorem.sentences(),
|
||||
notes: faker.lorem.sentences(),
|
||||
totalMeasurements: 0,
|
||||
sortOrder: faker.random.number(),
|
||||
canEdit: faker.random.boolean(),
|
||||
});
|
Reference in a new issue