Skip to content

Instantly share code, notes, and snippets.

@moustaki
Created October 11, 2010 13:49
Show Gist options
  • Save moustaki/620531 to your computer and use it in GitHub Desktop.
Save moustaki/620531 to your computer and use it in GitHub Desktop.
When /^I am on (.+)$/ do |page_name|
begin
visit path_to(page_name)
rescue Mechanize::ResponseCodeError => e
$stderr.puts "ERROR: " + e.page.root.xpath('//pre[@id="message"]/text()').to_s
raise Mechanize::ResponseCodeError.new e.page
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment