diff options
Diffstat (limited to 'spec/helpers/markup_helper_spec.rb')
-rw-r--r-- | spec/helpers/markup_helper_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb index c22e20f0e73..96c8b557625 100644 --- a/spec/helpers/markup_helper_spec.rb +++ b/spec/helpers/markup_helper_spec.rb @@ -531,8 +531,10 @@ describe MarkupHelper do it 'preserves style attribute for a label that can be accessed by current_user' do project = create(:project, :public) + label = create_and_format_label(project) - expect(create_and_format_label(project)).to match(/span class=.*style=.*/) + expect(label).to match(/span class=.*style=.*/) + expect(label).to include('data-html="true"') end it 'does not style a label that can not be accessed by current_user' do @@ -544,6 +546,15 @@ describe MarkupHelper do end end + it 'keeps whitelisted tags' do + html = '<a><i></i></a> <strong>strong</strong><em>em</em><b>b</b>' + + object = create_object(html) + result = first_line_in_markdown(object, attribute, 100, project: project) + + expect(result).to include(html) + end + it 'truncates Markdown properly' do object = create_object("@#{user.username}, can you look at this?\nHello world\n") actual = first_line_in_markdown(object, attribute, 100, project: project) |