Christian Metts wrote:
>Is it possible to test template helper methods while running
>functional unit tests? I didn''t see anything in any of the default
>assertions.
>
>So is there a way to do this easily? Or will it require building the
>response peice by peice and testing them at the right point in the
>process. And if the latter, could someone point me where I should to
>learn the Rails response process.
>
>TIA!
>
>-- Xian
>_______________________________________________
>Rails mailing list
>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
Depends on what kind of functionality you are putting inside the helper.
I never had to set up a full-fledged response object to unit-test
helpers, because my helpers mostly consist of small function-like
methods. If I need something bigger than this available to a view, I
make a separate class out of it and test it as such.
As for response object, look at response.rb in actionpack. It is _very_
simple beast.
--
Best regards,
Alexey Verkhovsky
Ruby Forum: http://ruby-forum.org (moderator)
RForum: http://rforum.andreas-s.net (co-author)
Instiki: http://instiki.org (maintainer)