Created
May 4, 2014 19:06
-
-
Save JoshCheek/a906099d3780f81317ec to your computer and use it in GitHub Desktop.
Using poltergeist to navigate the web.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara/rspec' | |
require 'capybara/poltergeist' | |
Capybara.javascript_driver = Capybara.current_driver = :poltergeist | |
describe 'google.com', type: :feature do | |
specify "I can search for and find testdouble's website" do | |
page.visit 'http://duckduckgo.com/' | |
page.fill_in 'q', with: 'test double' | |
page.click_on 'search_button_homepage' | |
page.click_link "Test Double | Custom Software Development | Columbus Ohio" | |
sleep 2 # <-- that's lame, maybe something in Capybara talks about this more | |
expect(page.body).to include "We're Test Double" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assumes:
brew install phantom
)