diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/lib/api/entities/wiki_page_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/lib/api/entities/wiki_page_spec.rb')
-rw-r--r-- | spec/lib/api/entities/wiki_page_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/api/entities/wiki_page_spec.rb b/spec/lib/api/entities/wiki_page_spec.rb index 238c8233a14..c75bba12484 100644 --- a/spec/lib/api/entities/wiki_page_spec.rb +++ b/spec/lib/api/entities/wiki_page_spec.rb @@ -43,6 +43,23 @@ RSpec.describe API::Entities::WikiPage do expect(subject[:content]).to eq("<div>
<p><strong>Test</strong> <em>content</em></p>
</div>") end end + + context 'when content contains a reference' do + let(:user) { create(:user) } + let(:project) { create(:project) } + let(:issue) { create(:issue, project: project) } + let(:wiki_page) { create(:wiki_page, wiki: project.wiki, title: 'page_with_ref', content: issue.to_reference) } + let(:expected_content) { %r{<a href=".*#{issue.iid}".*>#{issue.to_reference}</a>} } + + before do + params[:current_user] = user + project.add_developer(user) + end + + it 'expands the reference in the content' do + expect(subject[:content]).to match(expected_content) + end + end end context 'when it is false' do |