So i'm pretty new to rspec, i've used Cucumber in the past with Capybara but im trying to move more towards ACTUAL rspec with Capybara as opposed to Cucumber (I have no need for the BDD gherkin language in Cucumber)
My folder structure right now is spec/test_helper and spec/features/google_test.rb (just a sample for right now)
My gemfile has included:
gem 'capybara'
gem 'poltergeist'
gem 'selenium-webdriver'
gem 'rpsec'
my test_helper.rb file (In the project/spec folder)
#test_helper.rb
#Load up Capybara
require 'rspec'
require 'capybara/rspec'
require 'capybara'
require 'capybara/dsl'
#Load up Poltergeist
require 'capybara/poltergeist'
#Set JS Supported Driver
Capybara.javascript_driver = :poltergeist
my google_test.rb (In spec/features)
require 'test_helper'
Capybara.current_driver = :selenium
Capybara.run_server = false
Capybara.app_host = 'www.google.com'
describe "Visit Google Home Page", :type => feature do
it 'Google' do
visit ('/')
end
end
Running rspec spec/features/google_test.rb
I get:
Failures:
1) Visit Google Home Page Google Failure/Error: visit ('/') NoMethodError: undefined method
visit' for #<RSpec::ExampleGroups::VisitGoogleHomePage:0x007f8ef546ad30> # ./spec/features/google_test.rb:9:in
block (2 levels) in 'Finished in 0.00044 seconds (files took 0.47304 seconds to load) 1 example, 1 failure
Failed examples:
rspec ./spec/features/google_test.rb:8 # Visit Google Home Page Google
Any ideas?