I have a RESTful :new method to present a form. I have implemented this new method to use a params value params[:site_id]. For example, the URL to this form would be : http://localhost:3000/reviews/new?site_id=1005 Now I need to test this new method. How do I put in the params value in the test? The following line does not seem to do the work. get :new, :site_id => 1005 thanks. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
maybe it is expecting this?? {:review => {:site_id => 10000000000000005}} On Sun, Jan 3, 2010 at 6:45 PM, Vincent P <easebus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a RESTful :new method to present a form. I have implemented > this new method to use a params value params[:site_id]. For example, > the URL to this form would be : http://localhost:3000/reviews/new?site_id=1005 > Now I need to test this new method. How do I put in the params value > in the test? The following line does not seem to do the work. > > get :new, :site_id => 1005 > > thanks. > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
2010/1/4 Vincent P <easebus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> I have a RESTful :new method to present a form. I have implemented > this new method to use a params value params[:site_id]. For example, > the URL to this form would be : http://localhost:3000/reviews/new?site_id=1005 > Now I need to test this new method. How do I put in the params value > in the test? The following line does not seem to do the work. > > get :new, :site_id => 1005What do you mean by ''it does not work''? Do you mean the test does not work or the id does not appear in the params? What is shown in test.log for that request? Using ruby-debug or similar what is in params for that request? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sorry everyone. Wrong diagnostic. get :new, :site_id => 1005 is the correct way to pass params to "get." I just messed up my fixtures. That''s all. On Jan 4, 2:16 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2010/1/4 Vincent P <ease...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > I have a RESTful :new method to present a form. I have implemented > > this new method to use a params value params[:site_id]. For example, > > the URL to this form would be :http://localhost:3000/reviews/new?site_id=1005 > > Now I need to test this new method. How do I put in the params value > > in the test? The following line does not seem to do the work. > > > get :new, :site_id => 1005 > > What do you mean by ''it does not work''? Do you mean the test does not > work or the id does not appear in the params? What is shown in > test.log for that request? Using ruby-debug or similar what is in > params for that request? > > Colin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks to your help, I knew I needed to look somewhere else for the problem. Thanks. On Jan 4, 5:35 pm, Vincent P <ease...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Sorry everyone. Wrong diagnostic. > > get :new, :site_id => 1005 > > is the correct way to pass params to "get." I just messed up my > fixtures. That''s all. > > On Jan 4, 2:16 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > 2010/1/4 Vincent P <ease...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > I have a RESTful :new method to present a form. I have implemented > > > this new method to use a params value params[:site_id]. For example, > > > the URL to this form would be :http://localhost:3000/reviews/new?site_id=1005 > > > Now I need to test this new method. How do I put in the params value > > > in the test? The following line does not seem to do the work. > > > > get :new, :site_id => 1005 > > > What do you mean by ''it does not work''? Do you mean the test does not > > work or the id does not appear in the params? What is shown in > > test.log for that request? Using ruby-debug or similar what is in > > params for that request? > > > Colin > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.