On 2/9/06, Rick Bradley <[EMAIL PROTECTED]> wrote:
>
>      http://dev.rubyonrails.org/ticket/3775
>
> I'm hoping someone will pop up and tell me I'm simply daft with this
> ticket (and queries on IRC, and a prior post to the main Rails list),
> but I can't get a peep out of anyone so far.
>
> The question is, how do I write a simple test for a helper method which
> calls ActionView methods itself.  E.g., a foo_link() helper which calls
> link_to().  I noticed that Typo doesn't test these, though it seems to
> have tests for everything else.
>
> Am I missing something, or is there a gap here in Rails' testability?
>
> Best,
> Rick

Check out the ActionView tests.  Here's the tag helper tests, for example:

http://dev.rubyonrails.org/browser/trunk/actionpack/test/template/tag_helper_test.rb

The url_for tests require a controller, so you'll see some of them
creating fake controllers with the bare minimum defined.

--
Rick Olson
http://techno-weenie.net
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to