summaryrefslogtreecommitdiff
path: root/features/steps/shared/markdown.rb
blob: 782f3f0920bd6830a0e9e12d1f3868c424227817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
module SharedMarkdown
  include Spinach::DSL

  def header_should_have_correct_id_and_link(level, text, id, parent = ".wiki")
    page.find(:css, "#{parent} h#{level}##{id}").text.should == text
    page.find(:css, "#{parent} h#{level}##{id} > :last-child")[:href].should =~ /##{id}$/
  end

  step 'Header "Description header" should have correct id and link' do
    header_should_have_correct_id_and_link(1, 'Description header', 'description-header')
  end
end