Skip to content

Instantly share code, notes, and snippets.

@afgomez
Created June 6, 2013 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afgomez/5722807 to your computer and use it in GitHub Desktop.
Save afgomez/5722807 to your computer and use it in GitHub Desktop.
Easy way to allow remote inspection in poltergeist/capybara
# spec/features/random_spec.rb
require 'spec_helper'
describe "Random feature" do
it "Does't have debugging" do
# ...
# page.driver.debug
end
debugit "Does have debugging" do
# ...
page.driver.debug
end
end
# spec/spec_helper.rb
# ...
require 'capybara/poltergeist'
Capybara.register_driver :poltergeist_debug do |app|
Capybara::Poltergeist::Driver.new(app, :inspector => true)
end
# ...
# support/spec_methods.rb
def debugit( *args, &block )
it( *args, { driver: :poltergeist_debug, inspector: true }, &block )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment