get all selenium features to run and fix the badge update for notes

This commit is contained in:
Reinier Balt 2010-02-06 22:36:13 +01:00
parent c9566047fc
commit e1c693dfdc
4 changed files with 21 additions and 71 deletions

View file

@ -1,8 +1,16 @@
Then /the badge should show (.*)/ do |number|
# puts response.body.inspect
badge = -1
response.should have_xpath("//span[@id='badge_count']") do |node|
badge = node.first.content.to_i
xpath= "//span[@id='badge_count']"
if Rails.env == 'selenium'
response.should have_xpath(xpath)
badge = response.selenium.get_text("xpath=#{xpath}").to_i
else
response.should have_xpath(xpath) do |node|
badge = node.first.content.to_i
end
end
badge.should == number.to_i
end