Skip to content

Instantly share code, notes, and snippets.

@samnang
Forked from tjtuom/web_steps.rb
Created March 27, 2011 15:39
Show Gist options
  • Save samnang/889296 to your computer and use it in GitHub Desktop.
Save samnang/889296 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