ruby on rails ecommerce tests are failing, but why?

i am working through the Beginning Ruby on Rails Ecommerce book and on
page 101 where it is talking about integration tests, i run
test/integration/book_test.rb and it fails giving me the following
error message:

  1) Failure:
    [test/integration/book_test.rb:45:in `add_book'
     test/integration/book_test.rb:11:in `test_book_administration'
expected tag, but no tag found matching {:content=>"Ruby for Dummies",
:tag=>"td"} in:
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
href=\"/stylesheets/style.css?1164206463\" media=\"screen\"
rel=\"Stylesheet\" type=\"text/css\" />\n\t</head>\n\t<body>\n\t\t<div
id=\"header\">\n\t\t\t<h1 id=\"logo\">Emporium&trade;</h1>\n\t\t\t<h2
id=\"slogan\">Books on Rails</h2>\n\t\t</div>\n\n\t\t<div
id=\"notice\">\n\t\t\t\tBook was successfully
books</h1>\n\n<table>\n <tr>\n \n <th>Title</th>\n \n
<th>Published at</th>\n \n <th>Isbn</th>\n \n <th>Blurb</th>\n
\n <th>Price</th>\n \n <th>Created at</th>\n \n
<th>Updated at</th>\n \n </tr>\n \n\n <tr>\n \n <td>Ruby for
Dummies</td>\n \n <td>Mon Dec 04 09:27:30 CST 2006</td>\n \n
<td>123-123-123-X</td>\n \n <td>The best book released since
&quot;Eating for Dummies&quot;</td>\n \n <td>40.4</td>\n \n
<td>Mon Dec 04 09:27:30 CST 2006</td>\n \n <td>Mon Dec 04 09:27:30
CST 2006</td>\n \n <td><a
href=\"/admin/book/show/9\">Show</a></td>\n <td><a
href=\"/admin/book/edit/9\">Edit</a></td>\n <td><a
href=\"/admin/book/destroy/9\" onclick=\"if (confirm('Are you sure?'))
{ var f = document.createElement('form');
this.parentNode.appendChild(f); f.method = 'POST'; f.action =
this.href; f.submit(); };return false;\">Destroy</a></td>\n
</tr>\n\n</table>\n\n\n \n\n<br />\n\n<a href=\"/admin/book/new\">New
book</a>\n\n\t\t</div>\n\n\t\t<div id=\"footer\">&copy; 1995-2006
<nil> is not true.

looking through the code, i clearly see that "Ruby for Dummies" is in
fact in there and I also see that it is wrapped inside of "td" html
tags... so why is this test failing? i thought there might have been a
typo in my code somewhere, so i downloaded the sample code from the
site and i still got the same error message.

i'm new to TDD so i'm not really sure where to start troubleshooting this

The assert_tag is broken in Rails, you must edit the

vendor/rails/actionpack/lib/action_controller/test_process.rb file and change the implementation of html_document as follows:
 def html_document
@html_document ||=

From Mark Lund’s website:

Is this for the latest version of rails though? i'm not running edge or anything, just 1.1.6

Oops, my bad. Overlooked the - and + there. Try the fix for 1.1.6 and see if it works. If it does not you can always revert back to the old code.

The latest version has deprecated the assert_tag, assert_select is the replacement. So I don’t think that fix is for latest version.