fixed merge conflict in tests/index

This commit is contained in:
Matthew Dillon 2015-11-13 08:33:04 -07:00
commit 8730b6659f
116 changed files with 1793 additions and 1106 deletions

View file

@ -2,7 +2,7 @@ export default function() {
// Don't use mirage for development (for now)
this.urlPrefix = 'http://127.0.0.1:8901';
this.namespace = '/api';
this.passthrough();
this.passthrough('http://localhost:4200/**', 'http://127.0.0.1:8901/**');
}
export function testConfig() {
@ -10,7 +10,10 @@ export function testConfig() {
this.namespace = '/api/clostridium';
this.timing = 0;
this.get('/users');
this.post('/users');
this.get('/users/:id');
this.put('/users/:id');
this.get('/species');
this.post('/species');
@ -21,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');
}

View 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(),
});