Forum: Ruby on Rails [PATCH] Need help to write a test

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.
855c677aca7319a44da19fb583b9f320?d=identicon&s=25 Nicolas Cavigneaux (Guest)
on 2007-07-03 21:03
(Received via mailing list)
I'm trying to write a test for a modification I've done on link_to
helper. The problem is that my patch is relying on url_for behaviour
defined in link_to helper.

In url_helper_test.rb test file url_for is overwrited for testing
convinience.

So my question is how can I do to test my modification using the real
url_for method (the one in url_helper.rb). Is there a way to load it
from the inside of my test or something like this?

Thank you in advance.
--
Nicolas Cavigneaux
http://www.bounga.org
http://www.cavigneaux.net
A05834e9b5954947eb0ba3b570c47d5e?d=identicon&s=25 Pratik Naik (pratik)
on 2007-07-03 22:01
(Received via mailing list)
Check actionpack/test/template/url_helper_test.rb

Thanks,
Pratik

On 7/3/07, Nicolas Cavigneaux <nico@bounga.org> wrote:
> from the inside of my test or something like this?
> >
>


--
http://m.onkey.org
855c677aca7319a44da19fb583b9f320?d=identicon&s=25 Nicolas Cavigneaux (Guest)
on 2007-07-04 10:19
(Received via mailing list)
Le 3 juil. 07 à 21:59, Pratik a écrit :

>
> Check actionpack/test/template/url_helper_test.rb

That's the file in which I'm trying to write my test.

My question was : is it possible in my test method (in actionpack/
test/template/url_helper_test.rb) to use the real url_for()
implementation (the one in url_helper.rb file) rather than the one
implemented (for the sake of testing) in the test file.

I need to rely on the behaviour of url_for method implemented in
actionpack/lib/actionview/helpers/url_helper.rb. My modification
can't be tested without the original url_for implementation.

Any idea ?
--
Nicolas Cavigneaux
http://www.bounga.org
http://www.cavigneaux.net
This topic is locked and can not be replied to.