Forum: Ruby on Rails how to run test unit in controller

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7e35ecb8cb04c4c15cf0ad1a0edf113d?d=identicon&s=25 anton effendi (Guest)
on 2009-01-11 17:29
(Received via mailing list)
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
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-01-11 17:56
(Received via mailing list)
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:

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

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
7e35ecb8cb04c4c15cf0ad1a0edf113d?d=identicon&s=25 anton effendi (Guest)
on 2009-01-12 02:48
(Received via mailing list)
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 <phlip2005@gmail.com> wrote:

> You can run a script from the view like this:
>
>
> >
>


--
Wu You Duan
35eccc94955d9328d701ccaa3549a451?d=identicon&s=25 Brian (Guest)
on 2009-02-07 13:33
(Received via mailing list)
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
This topic is locked and can not be replied to.