Created
July 29, 2010 22:50
-
-
Save mourdok/499455 to your computer and use it in GitHub Desktop.
Correcting the mistake Spec::Expectations::ExpectationNotMetError in Culerity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to solve a small problem rubygem Culerity | |
# Want to return false results below: | |
# expected exist? to return true, got false (Spec::Expectations::ExpectationNotMetError) | |
# Located in: #{RAILS_ROOT}/features/step_definitions/culerity_steps.rb | |
# We have from the line 148 that: | |
Then /I should see "([^\"]*)"/ do |text| | |
# if we simply check for the browser.html content we don't find content that has been added dynamically, e.g. after an ajax call | |
div = $browser.div(:text, /#{Regexp::escape(text)}/) | |
div.should be_exist | |
end | |
Then /I should not see "([^\"]*)"/ do |text| | |
div = $browser.div(:text, /#{Regexp::escape(text)}/) | |
div.should_not be_exist | |
end | |
# Refactoring that after we get just that: | |
Then /I should see "([^\"]*)"/ do |text| | |
$browser.text.include?(text).should be_true | |
end | |
Then /I should not see "([^\"]*)"/ do |text| | |
$browser.text.include?(text).should_not be_true | |
end | |
# More information | |
# Visit: http://github.com/langalex/culerity/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you fork the repo and patch it yourself you will get the credit, if not i can just do it myself....