Railists: This snip works inside an index.rhtml. <%= render :partial => ''chat/index'', :locals => { :panel_id => 1 } %> Pretend for a moment that I know nothing about Rails. (:-) How do I write a test case that renders a partial and puts the result where goodies like assert_select can get into it? -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> This snip works inside an index.rhtml. > > <%= render :partial => ''chat/index'', > :locals => { :panel_id => 1 } > %>I now need an answer to a bigger problem. (Apologies for it''s impossible to Google for, because ''xml'' will give too many false hits.) Suppose I wanted to concoct an HTML page using an RXML template, because the source is so much cleaner and easier to refactor. When that chat/index is an RXML, something in the rendering system drops the Content-type: html/text from the outbound rendered contents. This truly sucks, because I can no longer use "convention over configuration". I have to put my XmlMarkup stuff into a function and call it the old-fashioned way. Oh, but now it''s easier to test as a partial... ;-)> -- > Phlip > http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 11/21/06, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Railists: > > This snip works inside an index.rhtml. > > <%= render :partial => ''chat/index'', > :locals => { :panel_id => 1 } > %> > > Pretend for a moment that I know nothing about Rails. (:-) > > How do I write a test case that renders a partial and puts the result > where goodies like assert_select can get into it? >Use Test::Rails, part of ZenTest. http://zentest.rubyforge.org/ZenTest/ - rob -- http://www.robsanheim.com http://www.seekingalpha.com http://www.ajaxian.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---