Re: [rspec-users] tutes on testing controllers

2008-03-14 Thread Oliver Barnes
I got the spec and controller minimally working now, here's the code paste for both in full. http://pastie.caboo.se/165743 still working on it, any suggestions on possible improvements would be greatly appreciated. 2008/3/14, Oliver Barnes <[EMAIL PROTECTED]>: > thanks, will do - I am still wrap

Re: [rspec-users] tutes on testing controllers

2008-03-14 Thread Oliver Barnes
should have posted the code, sorry about that :) http://pastie.caboo.se/165708 I was actually posting to :create, but hadn't added do_post() to the example :P adding it solved this specific problem, thanks. hope the pastie helps another newb out 2008/3/13, Shane Mingins <[EMAIL PROTECTED]>: > A

Re: [rspec-users] tutes on testing controllers

2008-03-14 Thread Oliver Barnes
thanks, will do - I am still wrapping my mind around mocks and stubs indeed :) 2008/3/13, Pat Maddox <[EMAIL PROTECTED]>: > On Thu, Mar 13, 2008 at 4:55 PM, Oliver Barnes > > <[EMAIL PROTECTED]> wrote: > > > I see. I had gotten to trying the first way you suggested (haven't > > tried the second

Re: [rspec-users] tutes on testing controllers

2008-03-13 Thread Pat Maddox
On Thu, Mar 13, 2008 at 4:55 PM, Oliver Barnes <[EMAIL PROTECTED]> wrote: > I see. I had gotten to trying the first way you suggested (haven't > tried the second yet): > > it "should assign an image to the work" do >@work.should_receive(:image=).with(@image) > end > > but I go

Re: [rspec-users] tutes on testing controllers

2008-03-13 Thread Shane Mingins
And the other thing I am not seeing you are calling create somewhere in the spec? Always a good idea to post all the code :-) Cheers Shane On 14/03/2008, at 12:55 PM, Oliver Barnes wrote: > I see. I had gotten to trying the first way you suggested (haven't > tried the second yet): > >

Re: [rspec-users] tutes on testing controllers

2008-03-13 Thread Shane Mingins
Are u stubbing Image.new and returning @image?? otherwise I think the error is accurately complaining that it did not receive :image= with the object that you have said. Cheers Shane On 14/03/2008, at 12:55 PM, Oliver Barnes wrote: > I see. I had gotten to trying the first way you suggested

Re: [rspec-users] tutes on testing controllers

2008-03-13 Thread Oliver Barnes
I see. I had gotten to trying the first way you suggested (haven't tried the second yet): it "should assign an image to the work" do @work.should_receive(:image=).with(@image) end but I got the following error: should assign an image to the work Mock 'Work_1002' expected :imag

Re: [rspec-users] tutes on testing controllers

2008-03-13 Thread Pat Maddox
On Thu, Mar 13, 2008 at 3:54 PM, Oliver Barnes <[EMAIL PROTECTED]> wrote: > thanks pat, it's still a good primer ;) > > I'm getting a better handle at it, but I'm still confused as to how to > test assigment of associated objects. for instance, how do I test this > (using attachment_fu)? > >

Re: [rspec-users] tutes on testing controllers

2008-03-13 Thread Oliver Barnes
thanks pat, it's still a good primer ;) I'm getting a better handle at it, but I'm still confused as to how to test assigment of associated objects. for instance, how do I test this (using attachment_fu)? @work.image = @image 2008/3/11, Pat Maddox <[EMAIL PROTECTED]>: > On Mon, Mar 10, 200

Re: [rspec-users] tutes on testing controllers

2008-03-10 Thread Pat Maddox
On Mon, Mar 10, 2008 at 2:01 PM, Oliver Barnes <[EMAIL PROTECTED]> wrote: > hello spec'ers, > > i'm in the hunt for guides on testing controllers with rspec, would > you guys recommend any? Oldie but goodie (I hope) - http://evang.eli.st/blog/2007/9/15/easy-controller-tests-and-expressing-intent

[rspec-users] tutes on testing controllers

2008-03-10 Thread Oliver Barnes
hello spec'ers, i'm in the hunt for guides on testing controllers with rspec, would you guys recommend any? thanks Oliver -- Oliver Azevedo Barnes [EMAIL PROTECTED] +55 11 9768 0193 http://www.linkedin.com/in/oliverbarnes http://workingwithrails.com/person/4704-oliver-barnes ___