Created
February 3, 2010 15:02
-
-
Save diasjorge/293663 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Then /^I should( not)? see a link to (.+)(?: with text "([^\"]*)")?$/ do |do_not, page_name, text| | |
url = path_to(page_name) | |
selector = "a:match_href('#{url}')" | |
if do_not | |
response_body.should_not have_selector(selector, :handler => CustomHandler::MatchHref.new) | |
else | |
response_body.should have_selector(selector, :handler => CustomHandler::MatchHref.new) do |element| | |
if text | |
element.should contain(text) | |
else | |
true | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment