tracks/features/step_definitions/generic_steps.rb
Eric Allen 05cbea50aa Using Rails.env is not the right approach here
All Cucumber stories now passing
2010-04-10 15:31:28 -04:00

16 lines
407 B
Ruby

Then /the badge should show (.*)/ do |number|
# puts response.body.inspect
badge = -1
xpath= "//span[@id='badge_count']"
if response.respond_to? :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