debian-mirror-gitlab/spec/helpers/wiki_helper_spec.rb

22 lines
546 B
Ruby
Raw Permalink Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
describe WikiHelper do
describe '#breadcrumb' do
context 'when the page is at the root level' do
it 'returns the capitalized page name' do
slug = 'page-name'
expect(helper.breadcrumb(slug)).to eq('Page name')
end
end
context 'when the page is inside a directory' do
it 'returns the capitalized name of each directory and of the page itself' do
slug = 'dir_1/page-name'
expect(helper.breadcrumb(slug)).to eq('Dir_1 / Page name')
end
end
end
end