forked from helpers/handlebars-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspecial_test.js
47 lines (37 loc) · 1.7 KB
/
special_test.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
(function() {
var Handlebars, context;
require('should');
Handlebars = require('handlebars');
require('../../lib/helpers/helpers-special').register(Handlebars, {});
context = {
AUTHORS: 'Brian Woodward (http://github.com/doowb)\nJon Schlinkert (http://github.com/jonschlinkert)'
};
describe('jsfiddle', function() {
describe('{{jsfiddle id}}', function() {
return it('should return a jsfiddle embed link, with default tabs assigned', function() {
var source, template;
source = '{{jsfiddle "UXbas"}}';
template = Handlebars.compile(source);
return template().should.equal('<iframe width="100%" height="300" src="http://jsfiddle.net/UXbas/embedded/result,js,html,css/presentation/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>');
});
});
return describe('{{jsfiddle id tabs}}', function() {
return it('should return a jsfiddle embed link, with custom tabs assigned', function() {
var source, template;
source = '{{jsfiddle "UXbas" "html,css"}}';
template = Handlebars.compile(source);
return template().should.equal('<iframe width="100%" height="300" src="http://jsfiddle.net/UXbas/embedded/html,css/presentation/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>');
});
});
});
describe('gist', function() {
return describe('{{gist id}}', function() {
return it('should return a gist script tag', function() {
var source, template;
source = '{{gist "abcdefg"}}';
template = Handlebars.compile(source);
return template().should.equal('<script src="https://gist.github.com/abcdefg.js"></script>');
});
});
});
}).call(this);