diff --git a/test/javascripts/components/bbcode_test.js b/test/javascripts/components/bbcode_test.js index c91bb0820c9..5941ed812d3 100644 --- a/test/javascripts/components/bbcode_test.js +++ b/test/javascripts/components/bbcode_test.js @@ -2,8 +2,9 @@ module("Discourse.BBCode"); var format = function(input, expected, text) { - // testing 1 2 3 - equal(Discourse.BBCode.format(input, {lookupAvatar: false}), expected, text); + + var cooked = Discourse.Markdown.cook(input, {lookupAvatar: false}); + equal(cooked, "

" + expected + "

", text); }; test('basic bbcode', function() { @@ -11,7 +12,7 @@ test('basic bbcode', function() { format("[i]emphasis[/i]", "emphasis", "italics text"); format("[u]underlined[/u]", "underlined", "underlines text"); format("[s]strikethrough[/s]", "strikethrough", "strikes-through text"); - format("[code]\nx++\n[/code]", "
\nx++\n
", "makes code into pre"); + format("[code]\nx++\n[/code]", "
\nx++ 
\n
", "makes code into pre"); format("[spoiler]it's a sled[/spoiler]", "it's a sled", "supports spoiler tags"); format("[img]http://eviltrout.com/eviltrout.png[/img]", "", "links images"); format("[url]http://bettercallsaul.com[/url]", "http://bettercallsaul.com", "supports [url] without a title"); @@ -81,17 +82,15 @@ test("quote formatting", function() { "renders quotes properly"); format("[quote=\"eviltrout, post:1, topic:1\"]abc[quote=\"eviltrout, post:2, topic:2\"]nested[/quote][/quote]", - "

\n

", + "

\n

", "can nest quotes"); format("before[quote=\"eviltrout, post:1, topic:1\"]first[/quote]middle[quote=\"eviltrout, post:2, topic:2\"]second[/quote]after", - "before

\n

middle

\n

after", + "before

\n

\n\n

middle

\n


\nafter", "can handle more than one quote"); });