I found this: controller.expect_render(:partial => ''thing'', :collection => things).once but I am trying to expect_render twice in my view spec: template.expect_render(:partial => ''order_details'').twice This doesn''t work as the template.expect_render call seems to be returning an array. Is it possible to expect the rendering of a partial twice in a view spec?
On 7/14/07, Jed Hurt <jed.hurt at gmail.com> wrote:> I found this: > > controller.expect_render(:partial => ''thing'', :collection => things).once > > but I am trying to expect_render twice in my view spec: > > template.expect_render(:partial => ''order_details'').twice > > > This doesn''t work as the template.expect_render call seems to be > returning an array. Is it possible to expect the rendering of a > partial twice in a view spec?Currently not (AFAICT). Could you submit an RFE, or better - a patch? Aslak> _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On 7/14/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> On 7/14/07, Jed Hurt <jed.hurt at gmail.com> wrote: > > I found this: > > > > controller.expect_render(:partial => ''thing'', :collection => things).once > > > > but I am trying to expect_render twice in my view spec: > > > > template.expect_render(:partial => ''order_details'').twice > > > > > > This doesn''t work as the template.expect_render call seems to be > > returning an array. Is it possible to expect the rendering of a > > partial twice in a view spec? > > Currently not (AFAICT). Could you submit an RFE, or better - a patch?Given that I this hasn''t been released yet and we want to a release soon, I broke form and just fixed this in trunk r2174. Cheers, David> > Aslak > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Works like a charm. Thanks! On 7/14/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 7/14/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote: > > On 7/14/07, Jed Hurt <jed.hurt at gmail.com> wrote: > > > I found this: > > > > > > controller.expect_render(:partial => ''thing'', :collection => things).once > > > > > > but I am trying to expect_render twice in my view spec: > > > > > > template.expect_render(:partial => ''order_details'').twice > > > > > > > > > This doesn''t work as the template.expect_render call seems to be > > > returning an array. Is it possible to expect the rendering of a > > > partial twice in a view spec? > > > > Currently not (AFAICT). Could you submit an RFE, or better - a patch? > > Given that I this hasn''t been released yet and we want to a release > soon, I broke form and just fixed this in trunk r2174. > > Cheers, > David > > > > > Aslak > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >