diff options
Diffstat (limited to 'spec/helpers/wiki_helper_spec.rb')
-rw-r--r-- | spec/helpers/wiki_helper_spec.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/helpers/wiki_helper_spec.rb b/spec/helpers/wiki_helper_spec.rb index bcc2bd71da1..4310e4bd22c 100644 --- a/spec/helpers/wiki_helper_spec.rb +++ b/spec/helpers/wiki_helper_spec.rb @@ -23,8 +23,13 @@ describe WikiHelper do describe '#wiki_sort_controls' do let(:project) { create(:project) } - let(:wiki_link) { helper.wiki_sort_controls(project, sort, direction) } - let(:classes) { "btn btn-default has-tooltip reverse-sort-btn qa-reverse-sort rspec-reverse-sort" } + let(:classes) { described_class::WIKI_SORT_CSS_CLASSES } + + subject(:wiki_link) do + helper.wiki_sort_controls(sort: sort, direction: direction) do |opts| + project_wikis_pages_path(project, opts) + end + end def expected_link(sort, direction, icon_class) path = "/#{project.full_path}/wikis/pages?direction=#{direction}&sort=#{sort}" @@ -62,6 +67,18 @@ describe WikiHelper do end end + describe '#wiki_show_children_icon' do + ProjectWiki::NESTINGS.each do |nesting| + context "When the nesting parameter is `#{nesting}`" do + let(:element) { helper.wiki_show_children_icon(nesting) } + + it 'produces something that contains an SVG' do + expect(element).to match(/svg/) + end + end + end + end + describe '#wiki_sort_title' do it 'returns a title corresponding to a key' do expect(helper.wiki_sort_title('created_at')).to eq('Created date') |