2013-10-26 03:23:29 +08:00
|
|
|
module("Discourse.HTML");
|
|
|
|
|
2015-01-21 05:13:42 +08:00
|
|
|
var html = Discourse.HTML;
|
2014-02-26 04:51:08 +08:00
|
|
|
|
|
|
|
test("customHTML", function() {
|
2015-01-21 05:13:42 +08:00
|
|
|
blank(html.getCustomHTML('evil'), "there is no custom HTML for a key by default");
|
2014-02-26 04:51:08 +08:00
|
|
|
|
2015-01-21 05:13:42 +08:00
|
|
|
html.setCustomHTML('evil', 'trout');
|
|
|
|
equal(html.getCustomHTML('evil'), 'trout', 'it retrieves the custom html');
|
2014-02-26 04:51:08 +08:00
|
|
|
|
|
|
|
PreloadStore.store('customHTML', {cookie: 'monster'});
|
2015-01-21 05:13:42 +08:00
|
|
|
equal(html.getCustomHTML('cookie'), 'monster', 'it returns HTML fragments from the PreloadStore');
|
|
|
|
|
2014-02-26 04:51:08 +08:00
|
|
|
});
|