Ghost/ghost/admin/tests/unit/components/gh-url-preview_test.js
Kevin Ansfield 753681e9e9 Standardize ember test names and file names
no issue
- standardize on "{TestType}: {ModuleType}: {module-name}" for test description strings
- standardize on `{module-name}-test.js` for test file names
- fix deprecation notices for ember component unit tests without explicit `unit: test` or `needs: []`
2015-10-06 17:31:03 +01:00

43 lines
1.1 KiB
JavaScript

import {
describeComponent,
it
} from 'ember-mocha';
describeComponent(
'gh-url-preview',
'Unit: Component: gh-url-preview',
{
unit: true
},
function () {
it('generates the correct preview URL with a prefix', function () {
var component = this.subject({
prefix: 'tag',
slug: 'test-slug',
tagName: 'p',
classNames: 'test-class',
config: {blogUrl: 'http://my-ghost-blog.com'}
});
this.render();
expect(component.get('url')).to.equal('my-ghost-blog.com/tag/test-slug/');
});
it('generates the correct preview URL without a prefix', function () {
var component = this.subject({
slug: 'test-slug',
tagName: 'p',
classNames: 'test-class',
config: {blogUrl: 'http://my-ghost-blog.com'}
});
this.render();
expect(component.get('url')).to.equal('my-ghost-blog.com/test-slug/');
});
}
);