diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-05-22 22:37:26 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-05-22 22:37:26 +0300 |
commit | 5431af8b3d4858ac72e796b42bd252d279e53f50 (patch) | |
tree | 7cbc98b0022a864557e07e8f0acedabc0b4ddbe9 /spec | |
parent | 20375f811a6ffa35568d70b97a3793b97231d0dd (diff) | |
parent | f9f9147290b5bc315e595e059c851593c1fc466f (diff) |
Merge branch '62116-performance-issue-502-errors-on-rendering-of-issues-with-heavy-markdown-contents' into 'master'
Resolve "Performance issue: 502 errors on rendering of issues with heavy markdown contents"
Closes #62116
See merge request gitlab-org/gitlab-ce!28597
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/page_layout_helper_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/helpers/page_layout_helper_spec.rb b/spec/helpers/page_layout_helper_spec.rb index cf98eed27f1..bf50763d06f 100644 --- a/spec/helpers/page_layout_helper_spec.rb +++ b/spec/helpers/page_layout_helper_spec.rb @@ -38,6 +38,14 @@ describe PageLayoutHelper do expect(helper.page_description).to eq 'Bold Header' end + + it 'truncates before sanitizing' do + helper.page_description('<b>Bold</b> <img> <img> <img> <h1>Header</h1> ' * 10) + + # 12 words because <img> was counted as a word + expect(helper.page_description) + .to eq('Bold Header Bold Header Bold Header Bold Header Bold Header Bold Header...') + end end describe 'page_image' do |