On 8/17/06, Keith Morrison <[EMAIL PROTECTED]> wrote:
Hi all,

I'd like to gauge the interest for a patch before I add to the already
large ticket list in Trac.

I've created a small patch that cleans up functional tests. With this
patch applied, functional tests can look just like unit tests.  There is
no need to open the controller class in order to define a rescue method
and there is no need to create the @controller, @request, and @response
variables.  These are done at runtime, based on the name of the test
class.  In addition, accessors methods are defined for controller,
request, and response.

This patch maintains backward compatibility with the current functional
test structure, and includes tests for the new functionality.

If there is interest in moving this into core, I would be happy to patch
the functional test generator to remove the cruft.

I've made this new behavior available via the TestInjector plugin, which
you can view/install from
http://www.infused.org/svn/plugins/test_injector, in case you'd like to
test out the behavior in your applications.  Once you install
TestInjector you will automatically get the benefits of the above
patch.  All of the other functionality of TestInjector has to be
explicitly enabled by you.

Comments, questions, suggestions?

Cheers,
Keith Morrison

This sounds very promising, if everything remains 100% compatible I'd
love to see it in 1.2/3.

One quick question - do you also use this for testing your helpers?
I've found some of the existing helper_test_cases to be a bit of a
pain.

- rob
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to