diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /spec/lib/gitlab/git/wiki_spec.rb | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) | |
download | gitlab-ce-41fe97390ceddf945f3d967b8fdb3de4c66b7dea.tar.gz |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'spec/lib/gitlab/git/wiki_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/wiki_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/lib/gitlab/git/wiki_spec.rb b/spec/lib/gitlab/git/wiki_spec.rb index ee0c0e2708e..dddcf8c40fc 100644 --- a/spec/lib/gitlab/git/wiki_spec.rb +++ b/spec/lib/gitlab/git/wiki_spec.rb @@ -48,14 +48,26 @@ RSpec.describe Gitlab::Git::Wiki do end it 'returns the right page' do - expect(subject.page(title: 'page1', dir: '').url_path).to eq 'page1' - expect(subject.page(title: 'page1', dir: 'foo').url_path).to eq 'foo/page1' + page = subject.page(title: 'page1', dir: '') + expect(page.url_path).to eq 'page1' + expect(page.raw_data).to eq 'content' + + page = subject.page(title: 'page1', dir: 'foo') + expect(page.url_path).to eq 'foo/page1' + expect(page.raw_data).to eq 'content foo/page1' end it 'returns nil for invalid arguments' do expect(subject.page(title: '')).to be_nil expect(subject.page(title: 'foo', version: ':')).to be_nil end + + it 'does not return content if load_content param is set to false' do + page = subject.page(title: 'page1', dir: '', load_content: false) + + expect(page.url_path).to eq 'page1' + expect(page.raw_data).to be_empty + end end describe '#preview_slug' do |