##Integration capybara with minitest
Requirements:
- ruby 1.9
- gem capybara
All you have to do is to require file test_helper.rb at the beginning of your test files.
require File.expand_path(File.dirname(__FILE__))+ "/test_helper.rb" | |
describe 'Gmail' do | |
it 'shows error message when login and password are incorrect' do | |
visit 'http://gmail.com' | |
within('form#gaia_loginform') do | |
fill_in('Email', :with => 'qwerty@example.com') | |
fill_in('Passwd', :with => 'qwerty12345') | |
click_button('Sign in') | |
end | |
assert has_css?('span#errormsg_0_Passwd', :text => 'The username or password you entered is incorrect.') | |
end | |
end |
require 'minitest/autorun' | |
require 'capybara/dsl' | |
MiniTest::Unit::TestCase.send(:include,Capybara::DSL) | |
Capybara.current_driver = :selenium |