Add WikiPage#to_partial_path

This commit is contained in:
Alex Braha Stoll 2016-12-26 23:51:34 -02:00
parent c8a1e96826
commit 84735186a8
2 changed files with 14 additions and 0 deletions

View File

@ -207,6 +207,12 @@ class WikiPage
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
def set_attributes

View File

@ -322,6 +322,14 @@ describe WikiPage, models: true do
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
def remove_temp_repo(path)