Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addon/components/bf-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ export default Ember.Component.extend({
@default application.namespace.name
@return {String} Application name
*/
appName: function() {
appName: Ember.computed(function() {
var ENV = this.container.lookupFactory('config:environment');
if (ENV.APP && ENV.APP.bonfire && ENV.APP.bonfire.title) {
return ENV.APP.bonfire.title;
} else {
return Ember.String.capitalize(ENV.APP.name);
}
}.property()
})
});
3 changes: 3 additions & 0 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ module.exports = function(environment) {
APP: {
// Here you can pass flags/options to your application instance
// when it is created
bonfire: {
title: "Testing bf-header"
}
}
};

Expand Down
16 changes: 7 additions & 9 deletions tests/unit/components/bf-header-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ import {
test
} from 'ember-qunit';

import ENV from "dummy/config/environment";

moduleForComponent('bf-header', {
// 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');
test('check if bonfire is in config', function(assert) {
assert.equal(Object.hasOwnProperty.call(ENV.APP, 'bonfire'), true);
});

// renders the component to the page
this.render();
assert.equal(component._state, 'inDOM');
test('check if bonfire title is in config', function(assert) {
assert.equal(Object.hasOwnProperty.call(ENV.APP.bonfire, 'title'), true);
});
23 changes: 0 additions & 23 deletions tests/unit/initializers/bf-header-test.js

This file was deleted.