summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2018-01-25 16:24:11 +0100
committerAhmad Sherif <me@ahmadsherif.com>2018-01-30 17:19:39 +0100
commitfa9d47f221fff4d75e3c50670aeeac7a3d675f7a (patch)
treea4011a1da4032cb131f1a53d65569cd8e7c59db9 /spec
parent98dd492766e3455d75fcab47a6abfa100d5c859c (diff)
downloadgitlab-ce-fa9d47f221fff4d75e3c50670aeeac7a3d675f7a.tar.gz
Migrate fetching wiki page formatted content to Gitalyfeature/migrate-wiki-page-formatted-data-to-gitaly
Closes gitaly#958
Diffstat (limited to 'spec')
-rw-r--r--spec/models/wiki_page_spec.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb
index cc9d79da708..9840afe6c4e 100644
--- a/spec/models/wiki_page_spec.rb
+++ b/spec/models/wiki_page_spec.rb
@@ -387,13 +387,23 @@ describe WikiPage do
end
describe '#formatted_content' do
- it 'returns processed content of the page', :disable_gitaly do
- subject.create({ title: "RDoc", content: "*bold*", format: "rdoc" })
- page = wiki.find_page('RDoc')
+ shared_examples 'fetching page formatted content' do
+ it 'returns processed content of the page' do
+ subject.create({ title: "RDoc", content: "*bold*", format: "rdoc" })
+ page = wiki.find_page('RDoc')
- expect(page.formatted_content).to eq("\n<p><strong>bold</strong></p>\n")
+ expect(page.formatted_content).to eq("\n<p><strong>bold</strong></p>\n")
- destroy_page('RDoc')
+ destroy_page('RDoc')
+ end
+ end
+
+ context 'when Gitaly wiki_page_formatted_data is enabled' do
+ it_behaves_like 'fetching page formatted content'
+ end
+
+ context 'when Gitaly wiki_page_formatted_data is disabled', :disable_gitaly do
+ it_behaves_like 'fetching page formatted content'
end
end