diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 18:07:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 18:07:55 +0300 |
commit | 85e494935a8726dc98bb19ffa584488420e5011e (patch) | |
tree | 5acf279dab81a2363e4504a9679c32c16510542b /spec/lib/gitlab/asciidoc_spec.rb | |
parent | 4ce0bee95df15c05cdb0d777eba31fe753bc443b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/asciidoc_spec.rb')
-rw-r--r-- | spec/lib/gitlab/asciidoc_spec.rb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/spec/lib/gitlab/asciidoc_spec.rb b/spec/lib/gitlab/asciidoc_spec.rb index ba5b70b44de..c8d159d1e84 100644 --- a/spec/lib/gitlab/asciidoc_spec.rb +++ b/spec/lib/gitlab/asciidoc_spec.rb @@ -518,6 +518,28 @@ module Gitlab end end + context 'when repository is passed into the context' do + let(:wiki_repo) { project.wiki.repository } + let(:include_path) { 'wiki_file.adoc' } + + before do + project.create_wiki + context.merge!(repository: wiki_repo) + end + + context 'when the file exists' do + before do + create_file(include_path, 'Content from wiki', repository: wiki_repo) + end + + it { is_expected.to include('<p>Content from wiki</p>') } + end + + context 'when the file does not exist' do + it { is_expected.to include("[ERROR: include::#{include_path}[] - unresolved directive]")} + end + end + context 'recursive includes with relative paths' do let(:input) do <<~ADOC @@ -562,8 +584,8 @@ module Gitlab end end - def create_file(path, content) - project.repository.create_file(project.creator, path, content, + def create_file(path, content, repository: project.repository) + repository.create_file(project.creator, path, content, message: "Add #{path}", branch_name: 'asciidoc') end end |