Skip to content

Instantly share code, notes, and snippets.

@mokevnin
Created October 17, 2012 19:05
Show Gist options
  • Save mokevnin/3907451 to your computer and use it in GitHub Desktop.
Save mokevnin/3907451 to your computer and use it in GitHub Desktop.
capybara example (bdd)
# gem install capybara
# gem install rspec
# rspec capybara_test.rb
require 'rubygems'
require 'capybara'
require 'capybara/rspec'
Capybara.configure do |c|
c.current_driver = :selenium
end
feature 'signing up' do
scenario "Signing in with incorrect credentials" do
visit('http://signin.ebay.com')
fill_in 'User ID', :with => 'user@example.com'
fill_in 'Password', :with => 'caplin'
click_button 'Sign in'
page.should have_content('Your user ID or password is incorrect.')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment