Re: [rspec-users] [rspec] Stubbing partials in view specs / Test Spy

2009-03-19 Thread Scott Taylor
On Mar 19, 2009, at 10:30 AM, David Chelimsky wrote: On Mar 19, 2009, at 7:59 AM, Evgeny Bogdanov > wrote: just upgraded to 1.2.0 the following code works now: template.stub!(:render).with(hash_including(:partial => "children/ child")) template.should_receive(:render).with(hash_including

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-03-19 Thread Nick Hoffman
> Basically, there are two situation. > 1) I want to check if a function was called and I want to execute the > function code I don't think that's possible. Setting a method expectation (Eg: template.should_receive(:render)) automatically stubs #render. > 2) I want to check if a function was call

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-03-19 Thread David Chelimsky
On Mar 19, 2009, at 7:59 AM, Evgeny Bogdanov wrote: just upgraded to 1.2.0 the following code works now: template.stub!(:render).with(hash_including(:partial => "children/ child")) template.should_receive(:render).with(hash_including(:partial => "children/child")) The only question th

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-03-19 Thread Evgeny Bogdanov
just upgraded to 1.2.0 the following code works now: template.stub!(:render).with(hash_including(:partial => "children/ child")) template.should_receive(:render).with(hash_including(:partial => "children/child")) The only question that is left for me is about Nick's words: "If you set a m

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-03-18 Thread Zach Dennis
On Wed, Mar 18, 2009 at 6:18 AM, Evgeny Bogdanov wrote: > Hello, > I have a problem similar to one mentioned in this post. > I call a partial inside another partial. > _mother.haml contains: > render :partial => "children/child" > > In mother_spec.rb file I am trying to stub the render call. > Her

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-03-18 Thread Zach Dennis
On Wed, Mar 18, 2009 at 4:35 PM, Nick Hoffman wrote: > Hey there Evgeny. My response is inline. > >> I call a partial inside another partial. >> _mother.haml contains: >> render :partial => "children/child" > >> In mother_spec.rb file I am trying to stub the render call. >> Here is a working versi

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-03-18 Thread Nick Hoffman
Hey there Evgeny. My response is inline. > I call a partial inside another partial. > _mother.haml contains: > render :partial => "children/child" > In mother_spec.rb file I am trying to stub the render call. > Here is a working version: > = >    template.should_receive(:render) >    

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-03-18 Thread Evgeny Bogdanov
Hello, I have a problem similar to one mentioned in this post. I call a partial inside another partial. _mother.haml contains: render :partial => "children/child" In mother_spec.rb file I am trying to stub the render call. Here is a working version: = template.should_receive(:rende

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-01-20 Thread Bart Zonneveld
On 20-jan-2009, at 15:29, David Chelimsky wrote: On Tue, Jan 20, 2009 at 7:44 AM, Bart Zonneveld wrote: Hey list, As a good BDDer I want to test my views in isolation. Sort of. A *good* BDDer wants to *specify* views in isolation. Testing is for testers :) You're right! I tend to talk a

Re: [rspec-users] [rspec] Stubbing partials in view specs

2009-01-20 Thread David Chelimsky
On Tue, Jan 20, 2009 at 7:44 AM, Bart Zonneveld wrote: > Hey list, > > As a good BDDer I want to test my views in isolation. Sort of. A *good* BDDer wants to *specify* views in isolation. Testing is for testers :) > And as a good rails > programmer, I separate views into partials when needed. So