blob: 479d276e6566c28f89191add55b45f19f4ef9e94 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
var Immutable = require('immutable');
var Page = require('../page');
describe('Page', function() {
describe('toText', function() {
it('must not prepend frontmatter if no attributes', function() {
var page = Page().merge({
content: 'Hello World'
});
expect(page.toText()).toBe('Hello World');
});
it('must prepend frontmatter if attributes', function() {
var page = Page().merge({
content: 'Hello World',
attributes: Immutable.fromJS({
hello: 'world'
})
});
expect(page.toText()).toBe('---\nhello: world\n---\n\nHello World');
});
});
});
|