Guys, Anybody know how to test the downloading stuff .. ? -- Posted via http://www.ruby-forum.com/. -- 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.
On 16 April 2010 08:10, Hemant Bhargava <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Guys, > > Anybody know how to test the downloading stuff .. ?What downloading stuff? 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.
@hemant what kind of crap question is this? be clear on your question On 16 April 2010 13:29, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 16 April 2010 08:10, Hemant Bhargava <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Guys, > > > > Anybody know how to test the downloading stuff .. ? > > What downloading stuff? > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- "Smile while you cry." "There are only two tragedies in life: one is not getting what one wants, and the other is getting it." -- 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.
Balasubramaniam Muthaiah wrote:> @hemant what kind of crap question is this? be clear on your questionHey what i mean was is that i have an link to pdf file.. and when i click on it in firefox, it prompts me to download the file.. (Development phase) Now i want to write a test for it(Test phase) just to check that is that downloading stuff is working fine or not.. Got it..> > -- > "Smile while you cry." > > "There are only two tragedies in life: one is not getting what one > wants, > and the other is getting it."-- Posted via http://www.ruby-forum.com/. -- 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.
I would suggest that you write the test first and then code. :) This test code would be in your functional tests which exercise the controller. You will need to do the get request for the file and then have your assertions check that what you get back is what you expect, a PDF file in this case. More info here: http://guides.rubyonrails.org/testing.html#functional-tests-for-your-controllers Have fun. -- 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.
On 16 April 2010 09:26, Hemant Bhargava <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Balasubramaniam Muthaiah wrote: >> @hemant what kind of crap question is this? be clear on your question > > Hey what i mean was is that i have an link to pdf file.. and when i > click on it in firefox, it prompts me to download the file.. > (Development phase)Do you mean it is literally just a link to a pdf file? If so then just check that the link is there on the page (using assert_select or equivalent for whatever testing tools you are using). There is nothing else to test. Colin> > Now i want to write a test for it(Test phase) just to check that is that > downloading stuff is working fine or not.. Got it.. > >> >> -- >> "Smile while you cry." >> >> "There are only two tragedies in life: one is not getting what one >> wants, >> and the other is getting it." > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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. > >-- 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.