problem with the catalog integration test

1 view
Skip to first unread message

yorks....@gmail.com

unread,
May 13, 2008, 12:18:26 PM5/13/08
to Beginning Ruby on Rails E-Commerce
Hi guys firstly I would like to congratulate you on a great book I am
enjoying learning Ruby on Rails Immensely thanks to your book, however
I have hit a bit of a stumbling block which does not appear to be
covered in the errata, running the integration test on page 116 gives
me the following failure:

1) Failure:
test_browsing_the_site(BrowsingAndSearchingTest)
[/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/
response_assertions.rb:26:in `assert_response'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/
response_assertions.rb:18:in `assert_response'
test/integration/browsing_and_searching_test.rb:19:in
`browse_index'
test/integration/browsing_and_searching_test.rb:8:in
`test_browsing_the_site'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
integration.rb:453:in `run']:
Expected response to be a <:success>, but was <500>

I have double checked all my code against the book and then double
checked it all against the downloadable sample code on the errata yet
i still get this problem I have tried looking into it but as I am
still quite new to RoR I'm not 100% on what i should be looking for, I
was wondering if there was an error in the book which is making this
test not pass.

I look forward to your reply

Lee

Jarkko Laine

unread,
May 13, 2008, 1:39:15 PM5/13/08
to railsec...@googlegroups.com

On 13.5.2008, at 19.18, yorks....@googlemail.com wrote:

>
> Hi guys firstly I would like to congratulate you on a great book I am
> enjoying learning Ruby on Rails Immensely thanks to your book, however
> I have hit a bit of a stumbling block which does not appear to be
> covered in the errata, running the integration test on page 116 gives
> me the following failure:
>
> 1) Failure:
> test_browsing_the_site(BrowsingAndSearchingTest)
> [/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
> ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/
> response_assertions.rb:26:in `assert_response'
> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
> ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/
> response_assertions.rb:18:in `assert_response'
> test/integration/browsing_and_searching_test.rb:19:in
> `browse_index'
> test/integration/browsing_and_searching_test.rb:8:in
> `test_browsing_the_site'
> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
> ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
> integration.rb:453:in `run']:
> Expected response to be a <:success>, but was <500>

This means that the action the test is trying to run is bombing. Can
you open up log/test.log and see the actual error that causes the 500?
Since you seem to be on OS X, you can open the log file in Console.app
and run the test again to easily see what's going on.

Cheers,
//jarkko

>
>
> I have double checked all my code against the book and then double
> checked it all against the downloadable sample code on the errata yet
> i still get this problem I have tried looking into it but as I am
> still quite new to RoR I'm not 100% on what i should be looking for, I
> was wondering if there was an error in the book which is making this
> test not pass.
>
> I look forward to your reply
>
> Lee
>

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Beginning Ruby on Rails E-Commerce" group.
> To post to this group, send email to railsec...@googlegroups.com
> To unsubscribe from this group, send email to railsecommerc...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/railsecommerce?hl=en
> -~----------~----~----~----~------~----~------~--~---
>

--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi


yorks....@googlemail.com

unread,
May 13, 2008, 2:33:27 PM5/13/08
to Beginning Ruby on Rails E-Commerce
Thanks for the quick reply I'm working on a bit of both OS X at work
and Windows XP at home so how would I go about doing this on my home
pc??

On May 13, 6:39 pm, Jarkko Laine <jar...@jlaine.net> wrote:
> Jarkko Lainehttp://jlaine.nethttp://dotherightthing.comhttp://www.railsecommerce.comhttp://odesign.fi
>
> smime.p7s
> 3KDownload

Jarkko Laine

unread,
May 13, 2008, 3:20:30 PM5/13/08
to railsec...@googlegroups.com

On 13.5.2008, at 21.33, yorks....@googlemail.com wrote:

>
> Thanks for the quick reply I'm working on a bit of both OS X at work
> and Windows XP at home so how would I go about doing this on my home
> pc??

The log file is just a text file so you can always open it up in a
text editor afterwards. However, I don't know about a log tailing
application like Console or tail on Windows. Anyone?

//jarkko

yorks....@googlemail.com

unread,
May 13, 2008, 3:43:32 PM5/13/08
to Beginning Ruby on Rails E-Commerce
i've managed to track down the test log for the last test i did and
here it is :
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/
gems/1.8/gems/actionpack-1.13.3/lib/action_controller/integration.rb:
152:in `get'
test/integration/browsing_and_searching_test.rb:17:in
`browse_index'
test/integration/browsing_and_searching_test.rb:8:in
`test_browsing_the_site'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/testcase.rb:78:in `__send__'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/testcase.rb:78:in `run'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
integration.rb:453:in `run'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/testsuite.rb:34:in `run'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/testsuite.rb:33:in `each'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/testsuite.rb:33:in `run'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/testsuite.rb:34:in `run'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/testsuite.rb:33:in `each'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/testsuite.rb:33:in `run'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/ui/console/testrunner.rb:67:in `start_mediator'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/autorunner.rb:216:in `run'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit/autorunner.rb:12:in `run'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/1.8/test/unit.rb:278
test/integration/browsing_and_searching_test.rb:31


Rendering /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
templates/rescues/layout.rhtml (500 Internal Error)
[4;36;1mSQL (0.001861) [0m [0;1mROLLBACK [0m

it seems to be something to do with these two lines
jill.browse_index

and

def browse_index

but as i isaid before I've checked the code for the test with both the
book and the sample code online and its no different.

Lee

On May 13, 8:20 pm, Jarkko Laine <jar...@jlaine.net> wrote:
> >> Jarkko Lainehttp://jlaine.nethttp://dotherightthing.comhttp://www.railsecommerce....
> >> ://odesign.fi
>
> >> smime.p7s
> >> 3KDownload

Jarkko Laine

unread,
May 13, 2008, 4:03:50 PM5/13/08
to railsec...@googlegroups.com

Can you paste a bit more of the log? The browse_index tries to fetch
an action which should show a normal log entry. Something like this:

Processing EventsController#index (for 127.0.0.1 at 2008-05-13
15:46:00) [GET]

...and a bunch of lines more. Your original error indicated that the
actual action (i.e. not the test code) was throwing an exception, so
the log file should contain a line for calling the action (like
above), and then something resulting in an exception. Do you see
anything like that?

Cheers,
//jarkko

yorks....@googlemail.com

unread,
May 13, 2008, 4:30:37 PM5/13/08
to Beginning Ruby on Rails E-Commerce
this should be of more help i've uploaded a copy of the test log for
you to go through :)

http://www.unborndesigns.co.uk/test.log

thanks for your help so far :)

Lee

On May 13, 9:03 pm, Jarkko Laine <jar...@jlaine.net> wrote:
> >> Jarkko Lainehttp://jlaine.nethttp://dotherightthing.comhttp://www.railsecommerce....

Jarkko Laine

unread,
May 13, 2008, 4:40:24 PM5/13/08
to railsec...@googlegroups.com

On 13.5.2008, at 23.30, yorks....@googlemail.com wrote:

>
> this should be of more help i've uploaded a copy of the test log for
> you to go through :)
>
> http://www.unborndesigns.co.uk/test.log
>
> thanks for your help so far :)

This is the interesting part:

ActionView::TemplateError (can't convert nil into Float) on line #8 of
app/views/catalog/index.rhtml:
5: <dd><%= author.last_name %>, <%= author.first_name %></dd>
6: <% end %>
7: <dd><%= pluralize(book.page_count, "page") %></dd>
8: <dd>Price: $<%= sprintf("%.2f", book.price) %></dd>
9: <dd><small>Publisher: <%= book.publisher.name %></small></dd>
10: <% end %>
11: </dl>

#{RAILS_ROOT}/app/views/catalog/index.rhtml:8:in `sprintf'

Like the error says, the price of the book is nil and it can't be
converted into a float. Either all the books should have a price set,
or there should be a check for it in the code:

<dd>Price: $<%= sprintf("%.2f", book.price) unless book.price.blank?
%></dd>

Or something like that.

If you want the price to be mandatory, use
validates_presence_of ;price in the Book model. I think that's in the
book but don't remember off the top of my head.

//jarkko

>
>
> Lee
>

yorks....@googlemail.com

unread,
May 13, 2008, 4:51:49 PM5/13/08
to Beginning Ruby on Rails E-Commerce
thanks for the reply much appreciated I will give your suggestion a
try, however I have had a look through everything I have done in the
book so far and I cant see "validates_presence_of :price" however
there is "validates_numericality_of :price"

thanks again for your help

Lee

On May 13, 9:40 pm, Jarkko Laine <jar...@jlaine.net> wrote:
> >> Jarkko Lainehttp://jlaine.nethttp://dotherightthing.comhttp://www.railsecommerce....

yorks....@googlemail.com

unread,
May 14, 2008, 4:10:04 AM5/14/08
to Beginning Ruby on Rails E-Commerce
following our conversation last night I have added a price into the
book fixture and have also made sure that the book model
validates_presence_of :price but now im getting a slightly different
failure

heres what terminal says when the test fails:

lee:~/projects/emporium g4$ ruby test/integration/
browsing_and_searching_test.rb
Loaded suite test/integration/browsing_and_searching_test
Started
F
Finished in 1.045242 seconds.

1) Failure:
test_browsing_the_site(BrowsingAndSearchingTest)
[/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/
tag_assertions.rb:102:in `assert_tag'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/
tag_assertions.rb:99:in `assert_tag'
test/integration/browsing_and_searching_test.rb:25:in
`browse_index'
test/integration/browsing_and_searching_test.rb:8:in
`test_browsing_the_site'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
integration.rb:453:in `run']:
expected tag, but no tag found matching
{:tag=>"dl", :attributes=>{:id=>"books"}, :children=>{:count=>10, :only=>{:tag=>"dt"}}}
in:
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\r
\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\"> \r\n<head>\r\n
<title>Book List</title>\r\n\r\n <link href=\"/stylesheets/style.css?
1162935640\" media=\"screen\" rel=\"Stylesheet\" type=\"text/css\" />\r
\n</head>\r\n<body>\r\n\r\n<div id=\"header\">\r\n <h1 id=\"logo
\">Emporium&trade;</h1>\r\n <h2 id=\"slogan\">Books on Rails</h2>\r
\n</div>\r\n\r\n<div id=\"menu\">\r\n <ul>\r\n <li><a href=\"/
admin/author\">Authors</a>&nbsp;|&nbsp;</li>\r\n <li><a href=\"/
admin/publisher\">Publishers</a>&nbsp;|&nbsp;</li>\r\n <li><a href=
\"/admin/book\">Books</a>&nbsp;|&nbsp;</li>\r\n <li><a href=\"/
catalog\">Catalog</a>&nbsp;|&nbsp;</li>\r\n <li><a href=\"/about
\">About</a>&nbsp;</li>\r\n </ul>\r\n</div>\r\n \r\n<div id=\"content
\">\r\n <h1>Book List</h1>\r\n \r\n <dl id=\"books\">\n \n
<dt><a href=\"/catalog/show/2\">Pro rails E-Commmerce 2nd Edition</a></
dt>\n \n <dd> pages</dd>\n <dd>Price: $40.00</dd>\n
<dd><small>Publisher: Apress</small></dd>\n \n <dt><a href=\"/
catalog/show/1\">Pro rails E-Commmerce</a></dt>\n \n
<dd>Hellsten, Christian</dd>\n \n <dd>Laine, Jarkko</dd>\n
\n <dd> pages</dd>\n <dd>Price: $40.00</dd>\n
<dd><small>Publisher: Apress</small></dd>\n \n</dl>\n\n\t\n\n\r\n</
div>\r\n\r\n<div id=\"footer\">\r\n &copy; 1995-2006 Emporium\r\n</div>
\r\n \r\n</body>\r\n</html>\r\n\r\n".
<nil> is not true.

1 tests, 3 assertions, 1 failures, 0 errors

and here is the log:


Processing CatalogController#index (for 127.0.0.1 at 2008-05-14
09:03:20) [GET]
Session ID: 22c100b4c96acfe1c9514e06432e3193
Parameters: {"action"=>"index", "controller"=>"catalog"}
[4;36;1mBook Columns (0.046350) [0m [0;1mSHOW FIELDS FROM
books [0m
[4;35;1mSQL (0.002057) [0m [0mSELECT count(DISTINCT books.id) AS
count_all FROM books LEFT OUTER JOIN authors_books ON
authors_books.book_id = books.id LEFT OUTER JOIN authors ON authors.id
= authors_books.author_id LEFT OUTER JOIN publishers ON publishers.id
= books.publisher_id [0m
[4;36;1mAuthor Columns (0.008102) [0m [0;1mSHOW FIELDS FROM
authors [0m
[4;35;1mPublisher Columns (0.004945) [0m [0mSHOW FIELDS FROM
publishers [0m
[4;36;1mBook Load IDs For Limited Eager Loading (0.004192) [0m
[0;1mSELECT id FROM books ORDER BY books.id desc LIMIT 0, 10 [0m
[4;35;1mBook Load Including Associations (0.002400) [0m
[0mSELECT books.`id` AS t0_r0, books.`title` AS t0_r1,
books.`publisher_id` AS t0_r2, books.`published_at` AS t0_r3,
books.`isbn` AS t0_r4, books.`blurb` AS t0_r5, books.`page_count` AS
t0_r6, books.`price` AS t0_r7, books.`created_at` AS t0_r8,
books.`updated_at` AS t0_r9, books.`cover_image` AS t0_r10,
authors.`id` AS t1_r0, authors.`first_name` AS t1_r1,
authors.`last_name` AS t1_r2, publishers.`id` AS t2_r0,
publishers.`name` AS t2_r1 FROM books LEFT OUTER JOIN authors_books ON
authors_books.book_id = books.id LEFT OUTER JOIN authors ON authors.id
= authors_books.author_id LEFT OUTER JOIN publishers ON publishers.id
= books.publisher_id WHERE books.id IN ('2', '1') ORDER BY books.id
desc [0m
Rendering within layouts/application
Rendering catalog/index
Completed in 0.16974 (5 reqs/sec) | Rendering: 0.05712 (33%) | DB:
0.06916 (40%) | 200 OK [http://www.example.com/catalog]
[4;36;1mSQL (0.000552) [0m [0;1mROLLBACK [0m

thanks again for your help and sorry to be such a pain.

Lee

On May 13, 9:51 pm, "yorks.terr...@googlemail.com"
> > Jarkko Lainehttp://jlaine.nethttp://dotherightthing.comhttp://www.railsecommerce....
>
> > smime.p7s
> > 3KDownload

yorks....@googlemail.com

unread,
May 14, 2008, 4:12:12 AM5/14/08
to Beginning Ruby on Rails E-Commerce
following our conversation last night I have added a price into the
book fixture and have also made sure that the book model
validates_presence_of :price but now im getting a slightly different
failure

heres what terminal says when the test fails:

lee:~/projects/emporium g4$ ruby test/integration/
browsing_and_searching_test.rb
Loaded suite test/integration/browsing_and_searching_test
Started
F
Finished in 1.045242 seconds.

1) Failure:
test_browsing_the_site(BrowsingAndSearchingTest)
[/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/
tag_assertions.rb:102:in `assert_tag'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/
tag_assertions.rb:99:in `assert_tag'
test/integration/browsing_and_searching_test.rb:25:in
`browse_index'
test/integration/browsing_and_searching_test.rb:8:in
`test_browsing_the_site'
/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/
ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
Lee
> > Jarkko Lainehttp://jlaine.nethttp://dotherightthing.comhttp://www.railsecommerce....
>
> > smime.p7s
> > 3KDownload

Jarkko Laine

unread,
May 14, 2008, 4:33:32 AM5/14/08
to railsec...@googlegroups.com

The count is probably just off, try changing that to match the actual
amount of books and you should be fine.

//jarkko

> div>\r\n\r\n<div id=\"footer\">\r\n &copy; 1995-2006 Emporium\r\n</
> div>

>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
>>>>>> integration.rb:453:in `run'

>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/testsuite.rb:34:in `run'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/testsuite.rb:33:in `each'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/testsuite.rb:33:in `run'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/testsuite.rb:34:in `run'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/testsuite.rb:33:in `each'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/testsuite.rb:33:in `run'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
>>>>>> `start_mediator'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/autorunner.rb:216:in `run'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/
>>>>>> ruby/1.8/test/unit/autorunner.rb:12:in `run'
>>>>>> /Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/
>>>>>> lib/

yorks....@googlemail.com

unread,
May 14, 2008, 5:03:35 AM5/14/08
to Beginning Ruby on Rails E-Commerce
thanks very much I've amended the count and now it seems to be these
two lines of hte test that are causing the failure:

assert_tag :tag => "dt", :content => "The Idiot"
check_book_links

I'm wondering if this i because none of the books defined in the
fixutres have any "content" specified?

Lee

On May 14, 9:33 am, Jarkko Laine <jar...@jlaine.net> wrote:
> ...
>
> read more »
>
> smime.p7s
> 3KDownload

yorks....@googlemail.com

unread,
May 14, 2008, 5:06:37 AM5/14/08
to Beginning Ruby on Rails E-Commerce
thanks very much I've amended the count and now it seems to be these
two lines of hte test that are causing the failure:

assert_tag :tag => "dt", :content => "The Idiot"
check_book_links

I'm wondering if this i because none of the books defined in the
fixutres have any "content" specified?

Lee

On May 14, 9:33 am, Jarkko Laine <jar...@jlaine.net> wrote:

Jarkko Laine

unread,
May 14, 2008, 5:17:23 AM5/14/08
to railsec...@googlegroups.com

On 14.5.2008, at 12.03, yorks....@googlemail.com wrote:

>
> thanks very much I've amended the count and now it seems to be these
> two lines of hte test that are causing the failure:
>
> assert_tag :tag => "dt", :content => "The Idiot"
> check_book_links
>
> I'm wondering if this i because none of the books defined in the
> fixutres have any "content" specified?

No, content refers to the content of the tag, so it's looking for
<dt>The Idiot</dt>, and there is seemingly not such a book.

yorks....@googlemail.com

unread,
May 14, 2008, 5:35:47 AM5/14/08
to Beginning Ruby on Rails E-Commerce
thanks very much I've amended the count and now it seems to be these
two lines of hte test that are causing the failure:

assert_tag :tag => "dt", :content => "The Idiot"
check_book_links

I'm wondering if this i because none of the books defined in the
fixutres have any "content" specified?

Lee

On May 14, 9:33 am, Jarkko Laine <jar...@jlaine.net> wrote:

yorks....@googlemail.com

unread,
May 14, 2008, 5:36:46 AM5/14/08
to Beginning Ruby on Rails E-Commerce
ahh I see, so basically if i change that for a book that is in the
fixtures it should pass?

On May 14, 10:17 am, Jarkko Laine <jar...@jlaine.net> wrote:

yorks....@googlemail.com

unread,
May 14, 2008, 5:41:48 AM5/14/08
to Beginning Ruby on Rails E-Commerce
I've got the test to pass by changing the content to one of hte books
in the fixtures, although strangely it only works if i take out the
following line too "check_book_links"

On May 14, 10:17 am, Jarkko Laine <jar...@jlaine.net> wrote:

yorks....@googlemail.com

unread,
May 14, 2008, 6:21:50 AM5/14/08
to Beginning Ruby on Rails E-Commerce
after reading on in the book and trying the next test i have found out
that the sample code you have online has had more books added to the
fixtures which when added helps both tests pass. :)

thanks for your help jarkko and keep up the good work :)

On May 14, 10:41 am, "yorks.terr...@googlemail.com"
> ...
>
> read more »

yorks....@googlemail.com

unread,
May 14, 2008, 7:52:39 AM5/14/08
to Beginning Ruby on Rails E-Commerce
after reading on in the book and trying the next test i have found out
that the sample code you have online has had more books added to the
fixtures which when added helps both tests pass. :)

thanks for your help jarkko and keep up the good work :)

On May 14, 10:41 am, "yorks.terr...@googlemail.com"
<yorks.terr...@googlemail.com> wrote:
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages