Guys, How can we test partials and layouts.. ? Googled but find nothing useful.. -- 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 Tue, Apr 13, 2010 at 5:06 AM, Hemant Bhargava <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Guys, > > How can we test partials and layouts.. ? Googled but find nothing > useful.. > --In the same way you test your views. You can use Selenium if you like. I don''t like the use of Selenium for this, I prefer to test the views contain the text that should be there and delegate the full testing of the view to a human tester. (Probably myself, but can be other people if you have a test team) Hope it helps. -- Leonardo Mateo. There''s no place like ~ -- 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.
Hi Leonardo, I am not using any tool for tesing. Neither i want to.. Leonardo Mateo wrote:>> -- > In the same way you test your views. You can use Selenium if you like. > I don''t like the use of Selenium for this, I prefer to test the views > contain the text that should be there and delegate the full testing of > the view to a human tester. (Probably myself, but can be other people > if you have a test team) > > Hope it helps. > > -- > Leonardo Mateo. > There''s no place like ~-- 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 Tue, Apr 13, 2010 at 11:33 AM, Hemant Bhargava <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi Leonardo, > > I am not using any tool for tesing. Neither i want to..So, you''re asking how to test your views, and you don''t want to use any tool for testing? I assume you have your reasons for not doing any testing, but if you don''t want to use any tool, you''ll have to test them by hand. -- Leonardo Mateo. There''s no place like ~ -- 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.
If you are using functional tests, then just use assert_select to verify that the HTML that the partial generates is somewhere in the response. For example, if you have a partial that prints out "<div>hello</div>", test a controller that has a view that calls that partial, and then do assert_select "div", "hello" then you''ll know the partial worked. On Tue, Apr 13, 2010 at 4:06 AM, Hemant Bhargava <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> Guys, > > How can we test partials and layouts.. ? Googled but find nothing > useful.. > -- > 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-/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. > >-- 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.