Merge branch 'fix/add-formatted-data-to-wiki-page' into 'master'
Add formatted_data attribute to Git::WikiPage Closes #39805 See merge request gitlab-org/gitlab-ce!16682
This commit is contained in:
commit
caf84a0306
2 changed files with 13 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Git
|
module Git
|
||||||
class WikiPage
|
class WikiPage
|
||||||
attr_reader :url_path, :title, :format, :path, :version, :raw_data, :name, :text_data, :historical
|
attr_reader :url_path, :title, :format, :path, :version, :raw_data, :name, :text_data, :historical, :formatted_data
|
||||||
|
|
||||||
# This class is meant to be serializable so that it can be constructed
|
# This class is meant to be serializable so that it can be constructed
|
||||||
# by Gitaly and sent over the network to GitLab.
|
# by Gitaly and sent over the network to GitLab.
|
||||||
|
@ -21,6 +21,7 @@ module Gitlab
|
||||||
@raw_data = gollum_page.raw_data
|
@raw_data = gollum_page.raw_data
|
||||||
@name = gollum_page.name
|
@name = gollum_page.name
|
||||||
@historical = gollum_page.historical?
|
@historical = gollum_page.historical?
|
||||||
|
@formatted_data = gollum_page.formatted_data if gollum_page.is_a?(Gollum::Page)
|
||||||
|
|
||||||
@version = version
|
@version = version
|
||||||
end
|
end
|
||||||
|
|
|
@ -386,6 +386,17 @@ describe WikiPage do
|
||||||
end
|
end
|
||||||
end
|
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')
|
||||||
|
|
||||||
|
expect(page.formatted_content).to eq("\n<p><strong>bold</strong></p>\n")
|
||||||
|
|
||||||
|
destroy_page('RDoc')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def remove_temp_repo(path)
|
def remove_temp_repo(path)
|
||||||
|
|
Loading…
Reference in a new issue