From 6043392e1a65aaca72e36090c71badf8ab1109cb Mon Sep 17 00:00:00 2001 From: Steven Sloan Date: Thu, 4 Apr 2013 15:05:20 -0400 Subject: [PATCH] add feature tests for markdown support in haml --- .../markdown_redcarpet_in_haml.feature | 42 ++++++++++++++++++ .../fixtures/markdown-in-haml-app/config.rb | 0 .../source/images/blank.gif | Bin 0 -> 43 bytes .../source/link_target.html.markdown | 4 ++ 4 files changed, 46 insertions(+) create mode 100644 middleman-more/features/markdown_redcarpet_in_haml.feature create mode 100644 middleman-more/fixtures/markdown-in-haml-app/config.rb create mode 100755 middleman-more/fixtures/markdown-in-haml-app/source/images/blank.gif create mode 100755 middleman-more/fixtures/markdown-in-haml-app/source/link_target.html.markdown diff --git a/middleman-more/features/markdown_redcarpet_in_haml.feature b/middleman-more/features/markdown_redcarpet_in_haml.feature new file mode 100644 index 00000000..1f40ecb7 --- /dev/null +++ b/middleman-more/features/markdown_redcarpet_in_haml.feature @@ -0,0 +1,42 @@ +@nojava +Feature: Markdown support in Haml + In order to test support of the Haml markdown filter + + Scenario: Markdown filter in Haml works + Given a fixture app "markdown-in-haml-app" + And a file named "config.rb" with: + """ + set :markdown_engine, :redcarpet + activate :directory_indexes + """ + And a file named "source/markdown_filter.html.haml" with: + """ + :markdown + # H1 + + paragraph + """ + Given the Server is running at "markdown-in-haml-app" + When I go to "/markdown_filter/" + Then I should see "

H1

" + Then I should see "

paragraph

" + + + Scenario: Markdown filter in Haml uses our link_to and image_tag helpers + Given a fixture app "markdown-in-haml-app" + And a file named "config.rb" with: + """ + set :markdown_engine, :redcarpet + activate :directory_indexes + """ + And a file named "source/link_and_image.html.haml" with: + """ + :markdown + [A link](/link_target.html) + + ![image](blank.gif) + """ + Given the Server is running at "markdown-in-haml-app" + When I go to "/link_and_image/" + Then I should see "/link_target/" + Then I should see 'src="/images/blank.gif"' diff --git a/middleman-more/fixtures/markdown-in-haml-app/config.rb b/middleman-more/fixtures/markdown-in-haml-app/config.rb new file mode 100644 index 00000000..e69de29b diff --git a/middleman-more/fixtures/markdown-in-haml-app/source/images/blank.gif b/middleman-more/fixtures/markdown-in-haml-app/source/images/blank.gif new file mode 100755 index 0000000000000000000000000000000000000000..2498f1aac58dab923f0fd99b1c8ee6b8c53c7158 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcKtd-pB_1B2pE79h#MpaUX6G7L;iE{qJ;0KEqWk^lez literal 0 HcmV?d00001 diff --git a/middleman-more/fixtures/markdown-in-haml-app/source/link_target.html.markdown b/middleman-more/fixtures/markdown-in-haml-app/source/link_target.html.markdown new file mode 100755 index 00000000..4f970c47 --- /dev/null +++ b/middleman-more/fixtures/markdown-in-haml-app/source/link_target.html.markdown @@ -0,0 +1,4 @@ +--- +layout: false +--- +Hello World \ No newline at end of file