Re: Beginning Ruby on Rails E-Commerce : Errata Help

Bala Paranj
2006-12-03T17:53:34Z

Cool. That solves the problem that I was having with my project. I
will try it out.

I was baffled, when I do curl I see the right page but when I do
assert_tag it bombs out!

On 12/3/06, Nick Coyne
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
>
> Finally solved this mystery -
>
> The first problem was that the newly created book wasn''t being
saved, so
> the ''new'' page was being displayed instead of
''create''. The cause of
> this was the date. When I changed
>
> :published_at => Time.now
>
> to
>
> :published_at => ''2006-11-01''
>
> then things were saved correctly and we ended up on the correct page.
>
> Next problem was that assert_tag wasn''t passing, even though I
could see
> the new book in the raw html. On
> http://wiki.marklunds.com/index.php?title=Test_Driven_Development_with_Ruby
> I found that assert_tag doesn''t work with integration tests unless
you
> make this change in test_process.rb
>
>      def html_document
> -      @html_document ||= HTML::Document.new(@response.body)
> +      HTML::Document.new(@response.body)
>      end
>
> Once I changed that then the integration test passed no problem.
>
> Nick.