Skip to content

Instantly share code, notes, and snippets.

@tjtuom
Created May 21, 2010 05:29
Show Gist options
  • Save tjtuom/408498 to your computer and use it in GitHub Desktop.
Save tjtuom/408498 to your computer and use it in GitHub Desktop.
Then /^(?:|I )should see "([^\"]*)"(?: within "([^\"]*)")?$/ do |text, selector|
with_scope(selector) do
if defined?(Spec::Rails::Matchers)
page.should have_xpath("//*[text()='#{text}']", :visible => true)
else
assert page.has_xpath("//*[text()='#{text}']", :visible => true)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment