diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-03-26 17:16:01 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-03-26 17:16:01 +0800 |
commit | ef6b3e0271d226462bed5f899f3964cf5652978c (patch) | |
tree | 191638ae3a0ffbdf71290dc5f29c4aa868a0ea2f /spec | |
parent | 1a9d80a139ea8de53fe32b7685daa696c1becbd0 (diff) | |
download | gitlab-ce-ef6b3e0271d226462bed5f899f3964cf5652978c.tar.gz |
Introduce #find_sidebar and use a constant to find the page14995-custom_wiki_sidebar
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/project_wiki_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index d87c1ca14f0..505746d78af 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -170,6 +170,22 @@ describe ProjectWiki do end end + describe '#find_sidebar' do + before do + create_page(described_class::SIDEBAR, 'This is an awesome Sidebar') + end + + after do + subject.pages.each { |page| destroy_page(page.page) } + end + + it 'finds the page defined as _sidebar' do + page = subject.find_page('_sidebar') + + expect(page.content).to eq('This is an awesome Sidebar') + end + end + describe '#find_file' do shared_examples 'finding a wiki file' do before do |