Testing (TDD) with Rails

I am looking for TDD resources that relate to Rails.

I saw the Rails Guide: The basics of creating a Rails plugin that really stimulated my interest in the topic.

I have a version of Agile Development with Rails, and I see some information related to testing there. However, it seems that the author walks you through the steps to create the application, and then adds testing later. This is not a test driven test .

Ideally, I would like a book on this subject, but the collection of other textbooks or articles would be great if such a book did not exist.

Things I would like to know:

  • Main Goal: Best Practices
  • Module testing
  • How to use lights
    • It is possible to use existing development data instead of fixtures
      • What level of community is here?
  • Writing tests for plugins
  • Testing with Session Data
    • User logged in
    • User can access URL / foo / bar
  • Testing Data Changes
    • Updating copyright publications
    • Product Status Changes in Reverse Order
    • User buys product (behavior?)
      • User logged in
      • The user has a valid address and a valid credit card.
      • Order record completed
      • Credit Card Transaction History Updated
      • Send email to user
  • Checking the success of sending email.
  • AJAX Testing
    • It is possible to test the general functionality of jQuery (interface elements, etc.)
  • RSpec
    • What place does RSpec have in a Rails application.
  • Future testing
    • Where is testing done? What happens on the way?
    • Rails 3?

!

+5
3

RSpec: , RSpec, . BDD, TDD, RSpec Cucumber. Rails, , . ( -).

+2

This is an older question, but I will add that Michael Hartl Learn Rails by Example views the user through TDD and covers most of the bullet points mentioned in the original question.

I will also add that Everyday Rails Testing with RSpec is a great purchase, especially since the author makes free updates available to customers after they have already bought the book, and he plans to update again in light of the release of Rails 4.

+1
source

All Articles