summaryrefslogtreecommitdiff
path: root/features/steps/shared/markdown.rb
diff options
context:
space:
mode:
authorCiro Santillli <ciro.santilli@gmail.com>2014-02-04 08:48:33 +0100
committerCiro Santillli <ciro.santilli@gmail.com>2014-02-11 16:23:33 +0100
commit61748c993de8a38300c0c038cec5a07e6c324cd6 (patch)
treeaf9693096914e2de64eaf5bdde06f59b90317eaa /features/steps/shared/markdown.rb
parent1284f21c073e42c44b9faa7b0ad1ec90b66ca8fb (diff)
downloadgitlab-ce-61748c993de8a38300c0c038cec5a07e6c324cd6.tar.gz
Headers have ids and link to their own id.
Diffstat (limited to 'features/steps/shared/markdown.rb')
-rw-r--r--features/steps/shared/markdown.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb
new file mode 100644
index 00000000000..782f3f0920b
--- /dev/null
+++ b/features/steps/shared/markdown.rb
@@ -0,0 +1,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