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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-23 15:08:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-23 15:08:38 +0300
commit5ad0cf26551baff8f08af8562a8d45e6ec14d71a (patch)
tree57f1a6bad31bcd11efacd3fdfb9cc92f88fb6a86 /spec/helpers
parentf47c768fad17d4c876e96524f83f8306f071db66 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/markup_helper_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb
index a775c69335e..2f91ab3afb3 100644
--- a/spec/helpers/markup_helper_spec.rb
+++ b/spec/helpers/markup_helper_spec.rb
@@ -138,10 +138,20 @@ describe MarkupHelper do
describe 'without redacted attribute' do
it 'renders the markdown value' do
expect(Banzai).to receive(:render_field).with(commit, attribute, {}).and_call_original
+ expect(Banzai).to receive(:post_process)
helper.markdown_field(commit, attribute)
end
end
+
+ context 'when post_process is false' do
+ it 'does not run Markdown post processing' do
+ expect(Banzai).to receive(:render_field).with(commit, attribute, {}).and_call_original
+ expect(Banzai).not_to receive(:post_process)
+
+ helper.markdown_field(commit, attribute, post_process: false)
+ end
+ end
end
describe '#link_to_markdown_field' do
@@ -565,6 +575,14 @@ describe MarkupHelper do
expect(doc.content).to eq "foo 😉\nbar 😀"
end
+
+ it 'does not post-process truncated text', :request_store do
+ object = create_object("hello \n\n [Test](README.md)")
+
+ expect do
+ first_line_in_markdown(object, attribute, nil, project: project)
+ end.not_to change { Gitlab::GitalyClient.get_request_count }
+ end
end
context 'when the asked attribute can be redacted' do