maček
maček

Reputation: 77778

Test Driven Development (TDD) with Rails

I am looking for TDD resources that are specific to Rails.

I've seen the Rails Guide: The Basics of Creating a Rails Plugin which really spurred my interest in the topic.

I have the Agile Development with Rails book and I see there's some testing-related information there. However, it seems like the author takes you through the steps of building the app, then adds testing afterward. This isn't really Test Driven Development.

Ideally, I'd like a book on this, but a collection of other tutorials or articles would be great if such a book doesn't exist.

Things I'd like to learn:

Thanks for any help!

Upvotes: 5

Views: 1244

Answers (3)

aceofbassgreg
aceofbassgreg

Reputation: 3937

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

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

Upvotes: 1

Gabriel Ščerbák
Gabriel Ščerbák

Reputation: 18570

Many of the points you mention are discussed in different episodes of Railscasts by Ryan Bates, including:

http://railscasts.com/episodes/275-how-i-test

http://railscasts.com/episodes/158-factories-not-fixtures-revised

http://railscasts.com/episodes?utf8=%E2%9C%93&search=cucumber

Upvotes: 1

zetetic
zetetic

Reputation: 47548

The RSpec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends. Focuses on BDD rather than TDD, but that's the whole point of RSpec and Cucumber. Not entirely specific to Rails, but has several chapters dedicated to it. Well written and up to date (though still in beta).

Upvotes: 2

Related Questions