diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/models/commit_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r-- | spec/models/commit_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index acbabee9383..a5f02b61132 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -400,6 +400,19 @@ eos allow(commit).to receive(:safe_message).and_return(message + "\n" + message) expect(commit.full_title).to eq(message) end + + it 'truncates html representation if more than 1KiB' do + # Commit title is over 2KiB on a single line + huge_commit_title = ('panic ' * 350) + 'trailing text' + + allow(commit).to receive(:safe_message).and_return(huge_commit_title) + + commit.refresh_markdown_cache + full_title_html = commit.full_title_html + + expect(full_title_html.bytesize).to be < 2.kilobytes + expect(full_title_html).not_to include('trailing text') + end end describe 'description' do |