diff --git a/app/mirage/config.js b/app/mirage/config.js index 02a1be7..a0fc750 100644 --- a/app/mirage/config.js +++ b/app/mirage/config.js @@ -1,11 +1,19 @@ export default function() { // Don't use mirage for development (for now) this.urlPrefix = 'http://127.0.0.1:8901'; - this.namespace = 'api'; + this.namespace = '/api'; this.passthrough(); } export function testConfig() { - this.urlPrefix = 'http://127.0.0.1:8901'; - this.namespace = 'api'; + this.urlPrefix = 'https://bactdb-test.herokuapp.com'; + this.namespace = '/api/hymenobacter'; + + this.get('/users/:id', function(db, request) { + return { 'user': db.users.find(request.params.id) }; + }); + + this.get('/species', function(db) { + return { 'species': db.species }; + }); } diff --git a/app/mirage/factories/contact.js b/app/mirage/factories/contact.js deleted file mode 100644 index 1b3a3ea..0000000 --- a/app/mirage/factories/contact.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - This is an example factory definition. - - Create more files in this directory to define additional factories. -*/ -import Mirage/*, {faker} */ from 'ember-cli-mirage'; - -export default Mirage.Factory.extend({ - // name: 'Pete', // strings - // age: 20, // numbers - // tall: true, // booleans - - // email: function(i) { // and functions - // return 'person' + i + '@test.com'; - // }, - - // firstName: faker.name.firstName, // using faker - // lastName: faker.name.firstName, - // zipCode: faker.address.zipCode -}); diff --git a/app/mirage/factories/species.js b/app/mirage/factories/species.js new file mode 100644 index 0000000..814b3f2 --- /dev/null +++ b/app/mirage/factories/species.js @@ -0,0 +1,11 @@ +import Mirage, { faker } from 'ember-cli-mirage'; + +export default Mirage.Factory.extend({ + speciesName: faker.lorem.words, + typeSpecies: faker.random.boolean, + etymology: faker.lorem.sentences, + genusName: 'hymenobacter', + strains: [], + totalStrains: 0, + sortOrder: faker.random.number, +}); diff --git a/app/mirage/factories/users.js b/app/mirage/factories/users.js new file mode 100644 index 0000000..7e14018 --- /dev/null +++ b/app/mirage/factories/users.js @@ -0,0 +1,8 @@ +import Mirage, { faker } from 'ember-cli-mirage'; + +export default Mirage.Factory.extend({ + name() { return faker.name.firstName() + ' ' + faker.name.lastName(); }, + email: faker.internet.email, + role: 'R', + canEdit: false, +}); diff --git a/app/pods/protected/species/index/species-table/template.hbs b/app/pods/protected/species/index/species-table/template.hbs index b56eba8..f96f9cf 100644 --- a/app/pods/protected/species/index/species-table/template.hbs +++ b/app/pods/protected/species/index/species-table/template.hbs @@ -1,4 +1,4 @@ -