Add WikiPage#to_partial_path
This commit is contained in:
parent
c8a1e96826
commit
84735186a8
|
@ -207,6 +207,12 @@ class WikiPage
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Relative path to the partial to be used when rendering collections
|
||||||
|
# of this object.
|
||||||
|
def to_partial_path
|
||||||
|
'projects/wikis/wiki_page'
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_attributes
|
def set_attributes
|
||||||
|
|
|
@ -322,6 +322,14 @@ describe WikiPage, models: true do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#to_partial_path' do
|
||||||
|
it 'returns the relative path to the partial to be used' do
|
||||||
|
page = build(:wiki_page)
|
||||||
|
|
||||||
|
expect(page.to_partial_path).to eq('projects/wikis/wiki_page')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def remove_temp_repo(path)
|
def remove_temp_repo(path)
|
||||||
|
|
Loading…
Reference in New Issue