Re: [rspec-users] expect_render

2008-09-29 Thread Scott Taylor
On Sep 29, 2008, at 5:02 PM, David Chelimsky wrote: On Mon, Sep 29, 2008 at 3:51 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: On Sep 29, 2008, at 4:36 PM, David Chelimsky wrote: On Mon, Sep 29, 2008 at 3:30 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: On Sep 29, 2008, at 3:54 PM, David Chel

Re: [rspec-users] expect_render

2008-09-29 Thread David Chelimsky
On Mon, Sep 29, 2008 at 3:51 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: > > On Sep 29, 2008, at 4:36 PM, David Chelimsky wrote: > >> On Mon, Sep 29, 2008 at 3:30 PM, Scott Taylor >> <[EMAIL PROTECTED]> wrote: >>> >>> On Sep 29, 2008, at 3:54 PM, David Chelimsky wrote: >>> On Mon, Sep 29, 2008

Re: [rspec-users] expect_render

2008-09-29 Thread Scott Taylor
On Sep 29, 2008, at 4:36 PM, David Chelimsky wrote: On Mon, Sep 29, 2008 at 3:30 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: On Sep 29, 2008, at 3:54 PM, David Chelimsky wrote: On Mon, Sep 29, 2008 at 2:52 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: I'm trying to write a spec asserting th

Re: [rspec-users] expect_render

2008-09-29 Thread David Chelimsky
On Mon, Sep 29, 2008 at 3:30 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: > > On Sep 29, 2008, at 3:54 PM, David Chelimsky wrote: > >> On Mon, Sep 29, 2008 at 2:52 PM, Scott Taylor >> <[EMAIL PROTECTED]> wrote: >>> >>> I'm trying to write a spec asserting that no layout should be used in a >>> contr

Re: [rspec-users] expect_render

2008-09-29 Thread Scott Taylor
On Sep 29, 2008, at 3:54 PM, David Chelimsky wrote: On Mon, Sep 29, 2008 at 2:52 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: I'm trying to write a spec asserting that no layout should be used in a controller. My spec currently looks like this: it "should render with no layout" do c

Re: [rspec-users] expect_render

2008-09-29 Thread David Chelimsky
On Mon, Sep 29, 2008 at 2:52 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: > > I'm trying to write a spec asserting that no layout should be used in a > controller. My spec currently looks like this: > >it "should render with no layout" do > controller.expect_render.with(hash_including(:lay

[rspec-users] expect_render

2008-09-29 Thread Scott Taylor
I'm trying to write a spec asserting that no layout should be used in a controller. My spec currently looks like this: it "should render with no layout" do controller.expect_render.with(hash_including(:layout => nil)) do_action end And this code, which should pass the s

Re: [rspec-users] expect_render(...).and_return('x')

2008-01-25 Thread David Chelimsky
On Jan 25, 2008 7:19 AM, Rob Holland <[EMAIL PROTECTED]> wrote: > David, > > Thanks for looking at the problem. > > > The trick here is that render :partial is NOT getting called on the > > controller - it's getting called on the template that is yielded to > > render :update. > > I think I follow,

Re: [rspec-users] expect_render(...).and_return('x')

2008-01-25 Thread Rob Holland
David, Thanks for looking at the problem. > The trick here is that render :partial is NOT getting called on the > controller - it's getting called on the template that is yielded to > render :update. I think I follow, still getting my head around that. > Here's the way I would handle this: http

Re: [rspec-users] expect_render(...).and_return('x')

2008-01-25 Thread David Chelimsky
On Jan 23, 2008 5:25 AM, Rob Holland <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to spec a controller method which renders some rjs as part > of a render :update block. The problem I'm having is that stub_render > or expect_render don't seem to allow and_return to work. > > The controller metho

Re: [rspec-users] expect_render(...).and_return('x')

2008-01-25 Thread Kevin Barnes
I've experienced very strange behavior with expect_render and stub_render as well as putting expectations on self in helper tests... It seems a lot of this weirdness started when I upgraded the rails plugin from 1.1.0 to 1.1.2. I use mocha instead of the rspec mocks - don't know if that is a ca

[rspec-users] expect_render(...).and_return('x')

2008-01-23 Thread Rob Holland
Hi, I'm trying to spec a controller method which renders some rjs as part of a render :update block. The problem I'm having is that stub_render or expect_render don't seem to allow and_return to work. The controller method does: if @thing.save render :update do

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-16 Thread Zach Dennis
> BDD is a process, not a result. The tools should support the process. > What you're asking for would stand in the way of this process. If there is a "disallow_unexpected_renders" that does not stand in the way of the process. It gives people a choice, much like integrate_views gives people a cho

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-16 Thread David Chelimsky
On 8/16/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > > > > > If i have a view that calls "render :partial => 'foo'" and I don't use > > > expect_render I want it to yell at me saying an unexpected call was > > > made on the template. > > > > There's nothing else in rspec_on_rails that yells at yo

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-16 Thread Zach Dennis
> > > > If i have a view that calls "render :partial => 'foo'" and I don't use > > expect_render I want it to yell at me saying an unexpected call was > > made on the template. > > There's nothing else in rspec_on_rails that yells at you because you > don't like to organize your specs the way rspec

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-15 Thread Zach Dennis
On 8/15/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/15/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > > > On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > > > On

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-15 Thread David Chelimsky
On 8/15/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > On 8/15/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On 8/15/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > > On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > > On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > > > > On 8/1

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-15 Thread David Chelimsky
On 8/15/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > > On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > > On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > > > > There

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-15 Thread Zach Dennis
On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > > > There is a warning on the web site about expect_render and stub_ren

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-14 Thread David Chelimsky
On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > > There is a warning on the web site about expect_render and stub_render: > > > > > > "WARNING: expect_render and stub_render, while

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-14 Thread Zach Dennis
On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > There is a warning on the web site about expect_render and stub_render: > > > > "WARNING: expect_render and stub_render, while very useful, act > > differently from standard Message Expec

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-13 Thread David Chelimsky
On 8/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > Is this a sign that expect_render is doing to much? > Agreed that expect_partial is doing to much, Oy vey - we BOTH used the wrong "to". Shame on both of us :) __

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-13 Thread David Chelimsky
On 8/14/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > There is a warning on the web site about expect_render and stub_render: > > "WARNING: expect_render and stub_render, while very useful, act > differently from standard Message Expectations (a.k.a. mock > expectations), which would never pass call

[rspec-users] expect_render, why does there need to be a warning

2007-08-13 Thread Zach Dennis
There is a warning on the web site about expect_render and stub_render: "WARNING: expect_render and stub_render, while very useful, act differently from standard Message Expectations (a.k.a. mock expectations), which would never pass calls through to the real object. This can be very confusing whe

Re: [rspec-users] expect_render not?

2007-08-13 Thread David Chelimsky
On 8/13/07, Jonathan Linowes <[EMAIL PROTECTED]> wrote: > hi, I have a template that conditionally renders a partial. Is there > a way to test that a partial is NOT rendered? > :) template.should_render(:partial => '/partial/that/should/not/get/rendered').never > > ___

[rspec-users] expect_render not?

2007-08-13 Thread Jonathan Linowes
hi, I have a template that conditionally renders a partial. Is there a way to test that a partial is NOT rendered? :) ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] expect_render twice in views

2007-07-14 Thread Jed Hurt
Works like a charm. Thanks! On 7/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 7/14/07, aslak hellesoy <[EMAIL PROTECTED]> wrote: > > On 7/14/07, Jed Hurt <[EMAIL PROTECTED]> wrote: > > > I found this: > > > > > > controller.expect_render(:partial => 'thing', :collection => things).once >

Re: [rspec-users] expect_render twice in views

2007-07-14 Thread David Chelimsky
On 7/14/07, aslak hellesoy <[EMAIL PROTECTED]> wrote: > On 7/14/07, Jed Hurt <[EMAIL PROTECTED]> 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(

Re: [rspec-users] expect_render twice in views

2007-07-14 Thread aslak hellesoy
On 7/14/07, Jed Hurt <[EMAIL PROTECTED]> 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 temp

[rspec-users] expect_render twice in views

2007-07-14 Thread Jed Hurt
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 p