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.
Nicolas C. (Guest)
on 2007-07-03 23: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 C.
http://www.bounga.org
http://www.cavigneaux.net
Pratik N. (Guest)
on 2007-07-04 00:01
(Received via mailing list)
Check actionpack/test/template/url_helper_test.rb

Thanks,
Pratik

On 7/3/07, Nicolas C. <removed_email_address@domain.invalid> wrote:
> from the inside of my test or something like this?
> >
>


--
http://m.onkey.org
Nicolas C. (Guest)
on 2007-07-04 12: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 C.
http://www.bounga.org
http://www.cavigneaux.net
This topic is locked and can not be replied to.