require_relative "../test_helper" class BlockHelperTest < ActiveSupport::TestCase include BlockHelper include ActionView::Helpers::TagHelper should 'escape title html' do assert_no_match //, block_title(unsafe('test')) assert_match /<b>test<\/b>/, block_title(unsafe('test')) end should 'escape subtitle html' do assert_no_match //, block_title('', unsafe('test')) assert_match /<b>test<\/b>/, block_title('', unsafe('test')) end should 'add "empty" class to blank subtitles tag' do assert_match "block-subtitle empty", block_title('', '') end end