This is a concise rspec guide written by David chelimsky. The original Article is here.
Introduction
To understand rspec, we need to first understand what is behaviour driven development (BDD), and BDD is an acceptance test driven planning ), domain driven design and agile development model of test driven development (TDD. Rspec provides TDD support for BDD development.
GEMS is usually required to test the rails project.
1. Cucumber --- the most promising
Cucumber Background: https://github.com/cucumber/cucumber/wiki/Cucumber-Backgrounder
Cucumber use 1: http://www.lycom.de/past/2008/11/28/cucumber01-2008-11-26/
Cucumber use 2: http://www.lycom.de/past/2008/11/29/cucumber02-2008-11-27/
Cucumber use 3: http://www.lycom.de/past/2008/11/30/cucumber03-2008-11-29/
Cucumber use 4: http://www.lycom.de/past/2008/12/5/cucumber04-2008-12-05/
Cucumber: http://www.lycom.de/past/tags/cucumber
-- Summary --: http://chinaonrails.com/topic/view/2002.html
Rspec-2 also: cucumber https://www.relishapp.com/rspec
1. rspec
Official documents: http://rspec.info/documentation/
Http://www.letrails.cn/archives/20/
Rspec-2 also: cucumber https://www.relishapp.com/rspec
2. capyium ---- need -- "Rack: Test and Selenium
Capybara aims to simplify the process of integration testing rack applications, such as rails, Sinatra or MerB. capybara simulates how a real user wowould interact with a web application. it is agnostic about the driver running your tests and currently comes with rack: Test and selenium support built in. htmlunit, WebKit and Env. JS are supported through external gems.
A complete reference is available at rubydoc.info.
It can be used with cucumber.
rails generate cucumber:install --capybara
It can also be used with rspec
Home: https://github.com/jnicklas/capybara
Help document: http://rubydoc.info/github/jnicklas/capybara/master
3. Gem install selenium-WebDriver ---- Automatic Testing Framework for IE/Firefox/Chrome/Android/iPhone
Webdriver is a tool for writing automatic tests of websites. It aims to mimic the behaviour of a real user,
And as such interacts with the HTML of the application.
Http://code.google.com/p/selenium/
Http://selenium.googlecode.com/svn/trunk/docs/api/rb/_index.html
Http://seleniumhq.org/
4.