features/step_definitions/posts_steps.rb in crowdblog-0.0.12 vs features/step_definitions/posts_steps.rb in crowdblog-0.0.13
- old
+ new
@@ -53,13 +53,23 @@
fill_in 'Title', with: 'A Great Post Title'
fill_in 'Body', with: 'I just wrote a loooooooong Post'
click_button 'Save'
end
+When /^I type in the post body field$/ do
+ fill_in 'Body', with: "# This is a title\n## And a subtitle"
+end
#*****************
# THEN steps
#-----------------
+
+Then /^I should see its markdown preview$/ do
+ preview = find('#post_preview')
+ preview.find('h1').should have_content('This is a title')
+ preview.find('h2').should have_content('And a subtitle')
+end
+
Then /^(?:|I )should not see the Test Post$/ do
posts = page.find('#posts table')
posts.should_not have_content 'This is a Test Post'
end