How to run test unit in controller


#1

Hai Guys…
I need help…
I want to run test:unit in controller and the result will show on
view…
Any body can help me???


Wu You Duan


#2

anton effendi wrote:

I want to run test:unit in controller and the result will show on
view… Any body can help me???

Wu You Duan

(BTW which one are you?)

You can run a script from the view like this:

<%=h `rake test:units` %>

However, why would you do such a thing? Unit tests should run while you
edit,
before you manually test in development mode, and way before production
mode.


Phlip


#3

I want to make monitoring 1 site…
I don’t have idea about it… so I think that is idea for solve…

do you have idea???

On Sun, Jan 11, 2009 at 11:55 PM, Phlip removed_email_address@domain.invalid wrote:

You can run a script from the view like this:


Wu You Duan


#4

Here’s a reason for running tests from a controller: Testing the
implementation of a 3rd party API.

I have a Rails app that sends RESTful requests to a third party who is
implementing the interface. The third party may or may not be using
Rails. I want to allow the third party to run our test suite and have
access to the test results so that they can verify their
implementation.

I haven’t implemented the interface yet, but this is a step in the
right direction for me.

Brian