Rspec usage in rails Projects

Source: Internet
Author: User

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.