require 'test_helper' # Test some event helper methods class EventsHelperTest < ActionView::TestCase test 'Markdown with empty content' do assert_equal '', to_markdown('') assert_equal '', to_markdown(' ') assert_equal "'", to_markdown("\'") assert_equal '', to_markdown(' ') end test 'HTML elements with a space inside' do assert_equal '**hello world**', to_markdown('hello world ') assert_equal '**h**,', to_markdown(' h,') assert_equal '**h**,', to_markdown('h ,') assert_equal '*ho***h**,', to_markdown('hoh ,') assert_equal '*ho* **h**,', to_markdown('ho h,') assert_equal '*ho* **h**,', to_markdown('ho h,') end test 'HTML titles too strong' do assert_equal '### Big ', to_markdown('

Big

') assert_equal '### Big again ', to_markdown('

Big again

') assert_equal '### **Too** ', to_markdown('

Too

') end end