Hi there, I''ve added an extra bunch of testing features for doing in-browser testing with Selenium, and am having quite a time figuring out how to use url_for with having a controller object present. I''ve tried using ActionController::Base.url_for and ActionView::Helpers::UrlHelper.url_for but haven''t been able to get something that works. What I want to be able to do is call url_for(:controller => ''test'', :action => ''index'') and have the URL string returned, anyone know how to do this? Cheers, Jonathan. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060112/f9dd6e49/attachment.html
I think that it might be: :use_full_path => true Mark On 1/11/06, Jonathan Viney <jviney@spreydon.org.nz> wrote:> > > > Hi there, > > > > I''ve added an extra bunch of testing features for doing in-browser testing > with Selenium, and am having quite a time figuring out how to use url_for > with having a controller object present. I''ve tried using > ActionController::Base.url_for and ActionView::Helpers::UrlHelper.url_for > but haven''t been able to get something that works. > > > > What I want to be able to do is call url_for(:controller => ''test'', :action > => ''index'') and have the URL string returned, anyone know how to do this? > > > > Cheers, Jonathan. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- -------------------------------------------------------------------- I am Mark Daggett and I approve this message.
Mmmm not really... include ActionView::Helpers::UrlHelper url_for(:controller => ''person'', :action => ''view'', :id => 1) gives a SystemStackError (too deep), and ActionController::Base.new.url_for() says that @url isn''t defined. Maybe I need to set up a controller and request/response object in the same way the functional tests do. -Jonny. -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of M Daggett Sent: Thursday, 12 January 2006 7:27 p.m. To: rails@lists.rubyonrails.org Subject: Re: [Rails] url_for in tests I think that it might be: :use_full_path => true Mark On 1/11/06, Jonathan Viney <jviney@spreydon.org.nz> wrote:> > > > Hi there, > > > > I''ve added an extra bunch of testing features for doing in-browsertesting> with Selenium, and am having quite a time figuring out how to useurl_for> with having a controller object present. I''ve tried using > ActionController::Base.url_for andActionView::Helpers::UrlHelper.url_for> but haven''t been able to get something that works. > > > > What I want to be able to do is call url_for(:controller => ''test'',:action> => ''index'') and have the URL string returned, anyone know how to dothis?> > > > Cheers, Jonathan. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- -------------------------------------------------------------------- I am Mark Daggett and I approve this message. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
I think the patch I just sent in might fix this for you: http://dev.rubyonrails.org/ticket/3517 CHEERS> SAM Jonathan Viney wrote:>Mmmm not really... > >include ActionView::Helpers::UrlHelper >url_for(:controller => ''person'', :action => ''view'', :id => 1) > >gives a SystemStackError (too deep), and > >ActionController::Base.new.url_for() says that @url isn''t defined. Maybe >I need to set up a controller and request/response object in the same >way the functional tests do. > >-Jonny. > >-----Original Message----- >From: rails-bounces@lists.rubyonrails.org >[mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of M Daggett >Sent: Thursday, 12 January 2006 7:27 p.m. >To: rails@lists.rubyonrails.org >Subject: Re: [Rails] url_for in tests > >I think that it might be: > >:use_full_path => true > >Mark > >On 1/11/06, Jonathan Viney <jviney@spreydon.org.nz> wrote: > > >> >>Hi there, >> >> >> >>I''ve added an extra bunch of testing features for doing in-browser >> >> >testing > > >>with Selenium, and am having quite a time figuring out how to use >> >> >url_for > > >>with having a controller object present. I''ve tried using >>ActionController::Base.url_for and >> >> >ActionView::Helpers::UrlHelper.url_for > > >>but haven''t been able to get something that works. >> >> >> >>What I want to be able to do is call url_for(:controller => ''test'', >> >> >:action > > >>=> ''index'') and have the URL string returned, anyone know how to do >> >> >this? > > >> >>Cheers, Jonathan. >>_______________________________________________ >>Rails mailing list >>Rails@lists.rubyonrails.org >>http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> >> >> > > >-- >-------------------------------------------------------------------- >I am Mark Daggett and I approve this message. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > > >