diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/helpers/markup_helper_spec.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/helpers/markup_helper_spec.rb')
-rw-r--r-- | spec/helpers/markup_helper_spec.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb index 6c5855eeb91..45e8a2e7e1a 100644 --- a/spec/helpers/markup_helper_spec.rb +++ b/spec/helpers/markup_helper_spec.rb @@ -316,6 +316,7 @@ RSpec.describe MarkupHelper do describe '#render_wiki_content' do let(:wiki) { double('WikiPage', path: "file.#{extension}") } let(:wiki_repository) { double('Repository') } + let(:content) { 'wiki content' } let(:context) do { pipeline: :wiki, project: project, wiki: wiki, @@ -325,9 +326,11 @@ RSpec.describe MarkupHelper do end before do - expect(wiki).to receive(:content).and_return('wiki content') + expect(wiki).to receive(:content).and_return(content) expect(wiki).to receive(:slug).and_return('nested/page') expect(wiki).to receive(:repository).and_return(wiki_repository) + allow(wiki).to receive(:container).and_return(project) + helper.instance_variable_set(:@wiki, wiki) end @@ -339,6 +342,19 @@ RSpec.describe MarkupHelper do helper.render_wiki_content(wiki) end + + context 'when context has labels' do + let_it_be(:label) { create(:label, title: 'Bug', project: project) } + + let(:content) { '~Bug' } + + it 'renders label' do + result = helper.render_wiki_content(wiki) + doc = Nokogiri::HTML.parse(result) + + expect(doc.css('.gl-label-link')).not_to be_empty + end + end end context 'when file is Asciidoc' do |