diff --git a/app/adapters/application.js b/app/adapters/application.js index 3653149..df3f515 100644 --- a/app/adapters/application.js +++ b/app/adapters/application.js @@ -2,7 +2,7 @@ import DS from 'ember-data'; import config from '../config/environment'; export default DS.RESTAdapter.reopen({ - namespace: 'api/hymenobacter', + namespace: 'api/' + config.genus, host: config.apiURL, coalesceFindRequests: true, }); diff --git a/app/components/genus-name.js b/app/components/genus-name.js new file mode 100644 index 0000000..61a389d --- /dev/null +++ b/app/components/genus-name.js @@ -0,0 +1,7 @@ +import Ember from 'ember'; +import config from '../config/environment'; + +export default Ember.Component.extend({ + tagName: 'em', + genus: config.genus.capitalize(), +}); diff --git a/app/templates/characteristics/index.hbs b/app/templates/characteristics/index.hbs index fbd2d23..e9d8ece 100644 --- a/app/templates/characteristics/index.hbs +++ b/app/templates/characteristics/index.hbs @@ -1,4 +1,4 @@ -

Hymenobacter Characteristics

+

{{genus-name}} Characteristics

Total characteristics: {{controller.length}}

diff --git a/app/templates/components/genus-name.hbs b/app/templates/components/genus-name.hbs new file mode 100644 index 0000000..9a7c043 --- /dev/null +++ b/app/templates/components/genus-name.hbs @@ -0,0 +1 @@ +{{genus}} diff --git a/app/templates/strains/index.hbs b/app/templates/strains/index.hbs index b84fce6..2ab1cb1 100644 --- a/app/templates/strains/index.hbs +++ b/app/templates/strains/index.hbs @@ -1,4 +1,4 @@ -

Hymenobacter Strains

+

{{genus-name}} Strains

Total strains: {{controller.length}}

diff --git a/config/environment.js b/config/environment.js index ec6ebb6..c9c1b9e 100644 --- a/config/environment.js +++ b/config/environment.js @@ -12,11 +12,11 @@ module.exports = function(environment) { // e.g. 'with-controller': true } }, - APP: { // Here you can pass flags/options to your application instance // when it is created - } + }, + genus: 'hymenobacter', }; if (environment === 'development') { diff --git a/tests/unit/components/genus-name-test.js b/tests/unit/components/genus-name-test.js new file mode 100644 index 0000000..8993325 --- /dev/null +++ b/tests/unit/components/genus-name-test.js @@ -0,0 +1,21 @@ +import { + moduleForComponent, + test +} from 'ember-qunit'; + +moduleForComponent('genus-name', { + // Specify the other units that are required for this test + // needs: ['component:foo', 'helper:bar'] +}); + +test('it renders', function(assert) { + assert.expect(2); + + // Creates the component instance + var component = this.subject(); + assert.equal(component._state, 'preRender'); + + // Renders the component to the page + this.render(); + assert.equal(component._state, 'inDOM'); +});