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_book_administration(BookTest)
    [test/integration/book_test.rb:45:in add_book' test/integration/book_test.rb:11:intest_book_administration’
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/integration.rb:431:in
    `run’]:
    expected tag, but no tag found matching {:content=>“Ruby for Dummies”,
    :tag=>“td”} in:
    “\n<html
    xmlsn=“http://www.w3.org/1999/xhtml”>\n\t\n\t\tEmporium\n\t\t<link
    href=”/stylesheets/style.css?1164206463" media=“screen”
    rel=“Stylesheet” type=“text/css” />\n\t\n\t\n\t\t<div
    id=“header”>\n\t\t\t<h1 id=“logo”>Emporium™\n\t\t\t<h2
    id=“slogan”>Books on Rails\n\t\t\n\n\t\t<div
    id=“menu”>\n\t\t\t
      \n\t\t\t\t
    • <a
      href="/admin/author">Authors | 
    • \n\t\t\t\t
    • <a
      href="/admin/publisher">Publishers | 
    • \n\t\t\t\t
    • <a
      href="/admin/book">Books | 
    • \n\t\t\t\t
    • <a
      href="/">Catalog | 
    • \n\t\t\t\t
    • <a
      href="/about">About 
    • \n\t\t\t
    \n\t\t\n\n\t\t<div
    id=“content”>\n\t\t\t\n\t\t\t\n\t\t\t\t<div
    id=“notice”>\n\t\t\t\tBook was successfully
    created.\n\t\t\t\t\n\t\t\t\n\t\t\t

    Listing
    books

    \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n
    TitlePublished atIsbnBlurbPriceCreated atUpdated at
    Ruby for DummiesMon Dec 04 09:27:30 CST 2006123-123-123-XThe best book released since "Eating for Dummies"40.4Mon Dec 04 09:27:30 CST 2006Mon Dec 04 09:27:30 CST 2006ShowEditDestroy
    \n\n\n \n\n
    \n\nNew book\n\n\t\t\n\n\t\t
    © 1995-2006 Emporium
    \n\t\n\n". 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 ||= HTML::Document.new(@response.body)
HTML::Document.new(@response.body)
end

From Mark Lund’s website:
http://wiki.marklunds.com/index.php?title=Test_Driven_Development_with_Ruby

Bala P. wrote:

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 ||= HTML::Document.new(@response.body)
HTML::Document.new(@response.body)
end

From Mark Lund’s website:
http://wiki.marklunds.com/index.php?title=Test_Driven_Development_with_Ruby

Actually, the patch removes the @html line. it should read

 def html_document
     HTML::Document.new(@response.body)
 end

http://wiki.marklunds.com/index.php?title=Test_Driven_Development_with_Ruby#Integration_tests

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.

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