Skip to content

Instantly share code, notes, and snippets.

Created February 13, 2013 22:10
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 anonymous/4948827 to your computer and use it in GitHub Desktop.
Save anonymous/4948827 to your computer and use it in GitHub Desktop.
require 'rspec'
require 'capybara/rspec'
require 'capybara-webkit'
require 'headless'
Headless.new.start
Capybara.default_driver = :webkit
feature do
it do
visit 'http://fortawesome.github.com/Font-Awesome/'
page.save_screenshot 'screenshot.png'
end
end
@IamNaN
Copy link

IamNaN commented Feb 13, 2015

You probably need to add the domain to capybara-webkit's whitelist. Before line 11, add the following:

page.driver.allow_url('fortawesome.github.com')

This would also work:

page.driver.allow_url('github.com')

As would:

page.driver.allow_url('fortawesome.github.com/Font-Awesome/*')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment