From 025cfa2686fc786c00ce3e7f2e570cc6c13fefeb Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 24 Mar 2010 20:45:59 +0100 Subject: [PATCH] fix cucumber story for markup in project description --- features/manage_project.feature | 4 ++-- features/step_definitions/project_steps.rb | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/features/manage_project.feature b/features/manage_project.feature index e6f35278..5db9910e 100644 --- a/features/manage_project.feature +++ b/features/manage_project.feature @@ -15,5 +15,5 @@ Feature: Manage a project Scenario: I can describe the project using markup When I visit the "manage me" project And I edit the project description to "_successfull outcome_: project is *done*" - Then I should see "successfull outcome" - And I should see " done" \ No newline at end of file + Then I should see the italic text "successfull outcome" in the project description + And I should see the bold text "done" in the project description \ No newline at end of file diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index 6d352c1e..f08d349d 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -23,6 +23,26 @@ end When /^I edit the project description to "([^\"]*)"$/ do |new_description| click_link "link_edit_project_#{@project.id}" - fill_in "project[description]", new_description + fill_in "project[description]", :with => new_description click_button "submit_project_#{@project.id}" end + +Then /^I should see the bold text "([^\"]*)" in the project description$/ do |bold| + xpath="//div[@class='project_description']/p/strong" + + response.should have_xpath(xpath) + bold_text = response.selenium.get_text("xpath=#{xpath}") + + puts "bt=#{bold_text}" + bold_text.should =~ /#{bold}/ +end + +Then /^I should see the italic text "([^\"]*)" in the project description$/ do |italic| + xpath="//div[@class='project_description']/p/em" + + response.should have_xpath(xpath) + italic_text = response.selenium.get_text("xpath=#{xpath}") + + puts "it=#{italic_text}" + italic_text.should =~ /#{italic}/ +end \ No newline at end of file