require 'test_helper' class HtmlGenerationTest < Test::Unit::TestCase context "basic behavior" do should "wrap in pre tags when preformatted" do block = new_block [[[:block_type, :preformatted], [:block_id, "some-id"], [:attribute_list]], "foo"] assert_equal "
foo", block.to_h end should "wrap in ul tags when unordered_list" do block = new_block [[[:block_type, :list], [:block_id, "some-id"], [:attribute_list]], "foo"] assert_equal "
yadda yadda yadda
}, block.to_h end should "add http:// to external links" do block = new_block [[[:block_type, :paragraph], [:block_id, "some-id"], [:attribute_list]], "yadda [yadda|example.com] yadda"] assert_equal %q{yadda yadda yadda
}, block.to_h end should "add create title if provided to external links" do block = new_block [[[:block_type, :paragraph], [:block_id, "some-id"], [:attribute_list]], "yadda [yadda|example.com|My title] yadda"] assert_equal %q{yadda yadda yadda
}, block.to_h end end end