Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2021-01-20 22:34:23 +0300
committerRobert Speicher <rspeicher@gmail.com>2021-01-20 22:34:23 +0300
commit6438df3a1e0fb944485cebf07976160184697d72 (patch)
tree00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/models/commit_spec.rb
parent42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff)
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index cfa87b3e39e..acbabee9383 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -428,6 +428,19 @@ eos
allow(commit).to receive(:safe_message).and_return(message)
expect(commit.description).to eq(message)
end
+
+ it 'truncates html representation if more than 1Mib' do
+ # Commit message is over 2MiB
+ huge_commit_message = ['panic', ('panic ' * 350000), 'trailing text'].join("\n")
+
+ allow(commit).to receive(:safe_message).and_return(huge_commit_message)
+
+ commit.refresh_markdown_cache
+ description_html = commit.description_html
+
+ expect(description_html.bytesize).to be < 2.megabytes
+ expect(description_html).not_to include('trailing text')
+ end
end
describe "delegation" do