I want to use capybara to drive a web browser for an application I have written. I don't want to run rspec tests, I want to use the browser to navigate and perform actions. How do I set this up to use capybara command like 'visit' ?
I have:
require 'selenium-webdriver'
require 'capybara'
Capybara.default_driver =:selenium
d= Selenium::WebDriver.for :chrome
d.navigate.to('http://www.google.com')
visit('http://www.google.com')
sleep 3
navigate.to works but visit gives me:
main.rb:6:in `<main>': undefined method `visit' for main:Object (NoMethodError)
I've tried adding include Capybara::DSL
but I get uninitialized constant Capybara::DSL (NameError)