fix cucumber story for markup in project description

This commit is contained in:
Reinier Balt 2010-03-24 20:45:59 +01:00
parent 8dbf790810
commit 025cfa2686
2 changed files with 23 additions and 3 deletions

View file

@ -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 "<i>successfull outcome<i>"
And I should see " <b>done</b>"
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

View file

@ -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