Commit 558ad69e authored by Lin Jen-Shin's avatar Lin Jen-Shin

Rearrange the tests and add another case where

it would still render the sidebar whenever the wiki is empty.
parent 44e4fd0b
......@@ -249,7 +249,18 @@ describe 'User creates wiki page' do
end
end
context 'when wiki has two pages' do
describe 'sidebar feature' do
context 'when the wiki is empty' do
it 'renders my customized sidebar' do
create(:wiki_page, wiki: wiki, attrs: { title: '_sidebar', content: 'My customized sidebar' })
visit(project_wikis_path(project))
expect(page).to have_content('My customized sidebar')
end
end
context 'when there are some existing pages' do
before do
create(:wiki_page, wiki: wiki, attrs: { title: 'home', content: 'home' })
create(:wiki_page, wiki: wiki, attrs: { title: 'another', content: 'another' })
......@@ -276,4 +287,5 @@ describe 'User creates wiki page' do
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment