small medium large xlarge

Errata for Rails Test Prescriptions

 

The latest version of the book is P1.0, released almost 6 years ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: B10.0 (13-Dec-10)
#45987
PDF page: 0

Highlighting the changed lines (added, modified, and maybe removed lines) of code will help follow-up faster with the code.--Ala'a

  • Reported in: P1.0 (02-Jul-12)
#49477
PDF page: 1

Location 2026 on Kindle (ipad), the code snippet has the line numbers displaying as ugly black blocks. The PDF version of this is fine.--Chris Johnson

  • Reported in: P1.0 (10-May-12)
#49303
PDF page: 24

On line 4, “the standard Ruby library Test:Unit” should be “Test::Unit”.--Frau Sma

  • Reported in: P1.0 (10-May-12)
#49304
PDF page: 30

In the setup method, “@project.users << fred” should read “@project.users << @fred”.--Frau Sma

  • Reported in: B10.0 (20-Jan-11)
#46281
PDF page: 34

In the final sentence on the page, "associate test directory" should be "associated test directory".--Cameron Desautels

  • Reported in: B10.0 (20-Jan-11)
#46282
PDF page: 36
Arguably a matter of taste, but in the first sentence of the third paragraph, "Performance tests are different than" should probably be "Performance t...more...
  • Reported in: P1.0 (10-May-12)
#49305
PDF page: 38

Near the end of the page, an extraneous “the” in “You will find much more discussion on the why fixture data is less commonly used”.--Frau Sma

  • Reported in: B11.0 (11-Feb-11)
#46384
PDF page: 48
Re: the Users fixture, you say: This particular fixture set was created in Appendix A, on page 323, and it defines the data object accessed as user...more...
  • Reported in: P1.0 (20-Jan-12)
#48554
PDF page: 54

include Devise::TestHelpers
needs to be outside "class ActionController::TestCase", isn't it ?--Alvise Susmel

  • Reported in: B11.0 (09-Feb-11)
#46375
PDF page: 55
Console output where it refers to a line of code does not correspond to that line in the source code that one downloads from PragProg.com i.e.(see ...more...
  • Reported in: P1.0 (20-Dec-12)
#50402
PDF page: 62

Walking THROUGH the site, Through, Not though. Second bullet point.

  • Reported in: P1.0 (09-Oct-12)
#49934
PDF page: 63

seventy-eleven?--Brian Maltzan

  • Reported in: B11.0 (14-Feb-11)
#46398
PDF page: 63
Sentence 2 on the page states that "filter methods can't take arguments". They can, if you use a lambda. For example: before_filter lambda { red...more...
  • Reported in: P1.0 (13-May-11)
#47060
PDF page: 73
"The assert_valid() test, which verifies that an ActiveRecord model is—wait for it—valid according to the rules of that model." It appears assert_v...more...
  • Reported in: P1.0 (25-Jun-12)
#49460
PDF page: 76

You use `create` to frequently, in my opinion. Why use it when you don't need to test persistence logic?

  • Reported in: P1.0 (20-Feb-11)
#46424
PDF page: 76
The objects created in each of the "full name" tests use variable "u1". The assert_equal assertions though use variable name "user." Also, should the ...more...
  • Reported in: P1.0 (15-May-11)
#47063
PDF page: 82
Line 9 of the Fred-and-Barney fixture example has: email: brubble@slaterockandgravel.com/ There is an extra trailing "/" on the end of the email...more...
  • Reported in: P1.0 (15-May-11)
#47065
PDF page: 88
All the previous chapters have showed how to use the tools being discussed by having you add to the Huddle project, which is a learn-by-doing style th...more...
  • Reported in: P1.0 (10-Oct-12)
#49938
PDF page: 90
Factory is no longer available. Factory.next is now FactoryGirl.generate. See github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md--Brian...more...
  • Reported in: P1.0 (28-Mar-11)
#46691
PDF page: 90
Paper page: 84

At the bottom of the page, Factory.next(:name) is deprecated.
This can be written as Factory.create(:name) instead.--James Silberbauer

  • Reported in: P1.0 (15-May-11)
#47064
PDF page: 90
The string defining the :name sequence uses an underscore: sequence :name do |n| "Project_#{n}" end Since all the previous examples of...more...
  • Reported in: P1.0 (01-May-12)
#49245
Paper page: 105
Second example cites the following: @bluebook = Project.make(:name => "Project Bluebook") @runway = Project.make(:name => "Project Runway") Wha...more...
  • Reported in: P1.0 (05-Jul-11)
#47250
PDF page: 111

@bluebook = Project.make(:name => "Project Bluebook")
@runway = Project.make(:name => "Project Runway")

s/make/new/--Jonathan Lim

  • Reported in: P1.0 (04-Jul-11)
#47245
PDF page: 112

Project.stub(:find).return(@bluebook)
should read
Project.stubs(:find).returns(@bluebook)--Jonathan Lim

  • Reported in: P1.0 (04-Jul-11)
#47246
PDF page: 112

In a factory universe, with only a couple of
object defined, that may not be a difficult constraint to live with.

s/object/objects/--Jonathan Lim

  • Reported in: P1.0 (05-Jul-11)
#47251
PDF page: 112

@bluebook = Project.make(:name => "Project Bluebook")

s/make/new/--Jonathan Lim

  • Reported in: P1.0 (08-Mar-11)
#46540
PDF page: 120

as as should read as

  • Reported in: P1.0 (10-Oct-12)
#49939
PDF page: 130

is blocked or diverted. s/is/are/--Brian Maltzan

  • Reported in: P1.0 (07-Mar-11)
#46534
PDF page: 154

line #2
easer to test;--Dinshaw Gobhai

  • Reported in: P1.0 (07-Mar-11)
#46536
PDF page: 158

Bunder should be read Bundler

  • Reported in: P1.0 (31-May-12)
#49390
PDF page: 175

The line
should "contain things"
is missing its “do”.--Frau Sma

  • Reported in: P1.0 (25-Mar-11)
#46678
PDF page: 176
"Shoulda defines specific one-liners for ActionController, ActionMailer, ActionView, ActiveRecord, and ActionMailer." ActionMailer listed twice (ok...more...
  • Reported in: P1.0 (31-May-12)
#49391
PDF page: 177

Again, the contexts are missing their “do”s.--Frau Sma

  • Reported in: B11.0 (10-Feb-11)
#46382
PDF page: 179
on the third paragraph there are a repetition of the word “ActionMailer”: Shoulda defines specific one-liners for ActionController, -->ActionMailer...more...
  • Reported in: P1.0 (14-Apr-11)
#46870
PDF page: 183
Paper page: 180
gem 'zebra' in a rails 3 application didn't work for me and I couldn't find it via gem search. Also Google is not helpful. So either I'm too dump or ...more...
  • Reported in: P1.0 (06-Mar-11)
#46522
PDF page: 203

On first line of page.

... intstance_of?()...--Rodrigo Machado

  • Reported in: P1.0 (20-May-14)
#76805
PDF page: 204

controller action and HTML method -> controller action and HTTP method--Ernest Walzel

  • Reported in: P1.0 (18-Dec-12)
#50389
PDF page: 283

Missing "with"? First sentence of fourth paragraph:

The second reason ... Has to do WITH the often-noted

--Octimizer