From joshua at zaadz.com Mon Apr 2 13:35:17 2007 From: joshua at zaadz.com (Joshua Warchol) Date: Mon, 02 Apr 2007 13:35:17 -0400 Subject: [Cells-talk] assert_template problems Message-ID: <46113ED5.4050001@zaadz.com> Hey Cell-ers, I'm trying to integrate the cells plugin that a coworker started using into a tool I'm writing. My tool has lots of testing, and when I started using cells I got test failures related to the assert_template assertion. Has anyone else seen these? In my integration test I use: assert_template 'administration/newsletters/design' and that results in this: expecting <"administration/newsletters/design"> but rendering with <"RAILS_ROOT/app/cells/layout/views/columns.rhtml"> Is this supposed to happen? Does cells just not play nicely with assert_template? Any suggestions for working around it? Many thanks, Josh -- Joshua Warchol Code Poet, Zaadz Inc. http://joshua.zaadz.com/ From nick at tesbo.com Fri Apr 20 07:03:07 2007 From: nick at tesbo.com (Nick Sutterer) Date: Fri, 20 Apr 2007 13:03:07 +0200 Subject: [Cells-talk] official opening of cells talk! Message-ID: <200704201303.07595.nick@tesbo.com> dear component-oriented developers, first of all i'm very happy about your interest in rails cells. it's cool to meet people sharing the same problems - and solutions! i'm ashamed i didn't reply to your mails on this list yet - being an absolute bum i forgot to add myself to the mailinglist and simply did not get any message :-D soon the trac page "Anatomy of a Cell" will be updated and will then act as a specification of cells. please regard this as a RFC and discuss it on the list. josh: i already pointed you to the cells cookbook, which includes hints about testing cells. anyway we should try to find a solution for the assert_template problem. i think the rendering cell must somehow "register" the current template in the controller. or did you already find a solution? mike: you asked about the "cells_tutorial/working_cells" route: the cells tutorial is a rails engine and thus provides another controller to your app ("CellsTutorial"). perhaps you don't have the engine plugin installed? hope to hear from you! cheers, nick From joshua at zaadz.com Fri Apr 20 09:47:08 2007 From: joshua at zaadz.com (Joshua Warchol) Date: Fri, 20 Apr 2007 09:47:08 -0400 Subject: [Cells-talk] official opening of cells talk! In-Reply-To: <200704201303.07595.nick@tesbo.com> References: <200704201303.07595.nick@tesbo.com> Message-ID: <4628C45C.2080804@zaadz.com> I'm happy to see this list starting up. As I had indicated, my main issue is that if a page is using cells you cannot test it with the assert_template method. I hope we can find a solution. So far my work around is to just comment out those assertions on the pages where they were failing. Hardly a good way to go. Josh Nick Sutterer wrote: > dear component-oriented developers, > > first of all i'm very happy about your interest in rails cells. it's cool to > meet people sharing the same problems - and solutions! > > i'm ashamed i didn't reply to your mails on this list yet - being an absolute > bum i forgot to add myself to the mailinglist and simply did not get any > message :-D > > > soon the trac page "Anatomy of a Cell" will be updated and will then act as a > specification of cells. please regard this as a RFC and discuss it on the > list. > > > josh: i already pointed you to the cells cookbook, which includes hints about > testing cells. anyway we should try to find a solution for the > assert_template problem. i think the rendering cell must somehow "register" > the current template in the controller. or did you already find a solution? > > > mike: > you asked about the "cells_tutorial/working_cells" route: the cells tutorial > is a rails engine and thus provides another controller to your app > ("CellsTutorial"). perhaps you don't have the engine plugin installed? > > > hope to hear from you! > > cheers, > > > nick > _______________________________________________ > Cells-talk mailing list > Cells-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/cells-talk > -- Joshua Warchol Code Poet, Zaadz Inc. http://joshua.zaadz.com/ From nick at tesbo.com Fri Apr 27 06:58:51 2007 From: nick at tesbo.com (Nick Sutterer) Date: Fri, 27 Apr 2007 12:58:51 +0200 Subject: [Cells-talk] assert_template problem In-Reply-To: <4628C45C.2080804@zaadz.com> References: <200704201303.07595.nick@tesbo.com> <4628C45C.2080804@zaadz.com> Message-ID: <200704271258.51623.nick@tesbo.com> hey josh, > issue is that if a page is using cells you cannot test it with the > assert_template method. I hope we can find a solution. So far my work > around is to just comment out those assertions on the pages where the > how do your assert_template statements look like? does the problem appear when a cell renders a template or when the called controller method renders a template? i just began bug hunting and tried the following, which worked: 1. call a controller method in the test, which calls render_cell_to_string, which invokes a cell state that renders the template "rendering_state.rhtml". 2. call assert_template "rendering_state.rhtml". this is ok. please tell me what you think! cheers, nick