Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-21 Thread Martin
Hello alltogether, thanks for your help. A mixture of stub_model and .errors.stub!() helped me to solve my problem. I also stumbled across the right arguments of have_tag. I thought it's similar to assert_select as the docs said. But it isn't. I found http://rubypond.com/articles/2008/03/31

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-20 Thread Zach Dennis
On Fri, Feb 20, 2009 at 12:59 PM, Pat Maddox wrote: > On Fri, Feb 20, 2009 at 6:20 AM, Matt Wynne wrote: >> >> On 19 Feb 2009, at 21:53, Zach Dennis wrote: >> >>> On Thu, Feb 19, 2009 at 4:24 PM, Matt Wynne wrote: On 19 Feb 2009, at 20:54, Martin wrote: > Hi, > > I'm t

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-20 Thread Pat Maddox
On Fri, Feb 20, 2009 at 6:20 AM, Matt Wynne wrote: > > On 19 Feb 2009, at 21:53, Zach Dennis wrote: > >> On Thu, Feb 19, 2009 at 4:24 PM, Matt Wynne wrote: >>> >>> On 19 Feb 2009, at 20:54, Martin wrote: >>> Hi, I'm trying to test my views using rspec. I want to test my edit- and >

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-20 Thread Zach Dennis
On Fri, Feb 20, 2009 at 9:20 AM, Matt Wynne wrote: > > On 19 Feb 2009, at 21:53, Zach Dennis wrote: > >> On Thu, Feb 19, 2009 at 4:24 PM, Matt Wynne wrote: >>> >>> On 19 Feb 2009, at 20:54, Martin wrote: >>> Hi, I'm trying to test my views using rspec. I want to test my edit- and >

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-20 Thread Matt Wynne
On 19 Feb 2009, at 21:53, Zach Dennis wrote: On Thu, Feb 19, 2009 at 4:24 PM, Matt Wynne wrote: On 19 Feb 2009, at 20:54, Martin wrote: Hi, I'm trying to test my views using rspec. I want to test my edit- and new-view also for the case an error occurs (something like "title can't be b

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-19 Thread Zach Dennis
On Thu, Feb 19, 2009 at 4:51 PM, Zach Dennis wrote: > On Thu, Feb 19, 2009 at 3:54 PM, Martin wrote: >> Hi, >> >> I'm trying to test my views using rspec. I want to test my edit- and >> new-view also for the case an error occurs (something like "title can't be >> blank" and so on). >> Can someone

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-19 Thread Zach Dennis
On Thu, Feb 19, 2009 at 3:54 PM, Martin wrote: > Hi, > > I'm trying to test my views using rspec. I want to test my edit- and > new-view also for the case an error occurs (something like "title can't be > blank" and so on). > Can someone point me please to an example where I can see how to mock my

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-19 Thread Zach Dennis
On Thu, Feb 19, 2009 at 4:24 PM, Matt Wynne wrote: > > On 19 Feb 2009, at 20:54, Martin wrote: > >> Hi, >> >> I'm trying to test my views using rspec. I want to test my edit- and >> new-view also for the case an error occurs (something like "title can't be >> blank" and so on). >> Can someone poin

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-19 Thread David Chelimsky
On Thu, Feb 19, 2009 at 2:54 PM, Martin wrote: > Hi, > > I'm trying to test my views using rspec. I want to test my edit- and > new-view also for the case an error occurs (something like "title can't be > blank" and so on). > Can someone point me please to an example where I can see how to mock my

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-19 Thread Jim Gay
On Feb 19, 2009, at 3:54 PM, Martin wrote: Hi, I'm trying to test my views using rspec. I want to test my edit- and new-view also for the case an error occurs (something like "title can't be blank" and so on). Can someone point me please to an example where I can see how to mock my mode

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-19 Thread Bart Zonneveld
On 19 feb 2009, at 21:54, Martin wrote: Hi, I'm trying to test my views using rspec. I want to test my edit- and new-view also for the case an error occurs (something like "title can't be blank" and so on). Can someone point me please to an example where I can see how to mock my model

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-19 Thread Matt Wynne
On 19 Feb 2009, at 20:54, Martin wrote: Hi, I'm trying to test my views using rspec. I want to test my edit- and new-view also for the case an error occurs (something like "title can't be blank" and so on). Can someone point me please to an example where I can see how to mock my model

[rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-19 Thread Martin
Hi, I'm trying to test my views using rspec. I want to test my edit- and new-view also for the case an error occurs (something like "title can't be blank" and so on). Can someone point me please to an example where I can see how to mock my model and stub all methods needed for the view? Th