Re: [rspec-users] Depot app, Demeter's law and troubles cleanly specing

2009-11-26 Thread Emerson Macedo
Fernando Perez wrote: > Hi, > > Let's take the example of the depot app. In my controller I set @order. > Then in the view comes the bad stuff: > > @order.items.each do |item| > item.product.title > end > > Now I'm having problems specing item.product.title. A quick and dirty > fix is to trade

Re: [rspec-users] how to test a observer model?

2009-11-26 Thread Zhenning Guan
Matt Wynne wrote: > You can do something like this to sense the value passed to the user > object: > Obviously the precise specifications of the key are up to you and your > stakeholders, but that should show you how you can test it. > > cheers, > Matt > > http://mattwynne.net > +447974 430184 t

Re: [rspec-users] how to test a observer model?

2009-11-26 Thread Matt Wynne
On 26 Nov 2009, at 02:31, Zhenning Guan wrote: I have a user_observer, code like this: def after_create(user) UserMailer.deliver_signup_notification(user) user.random_key = random_key_method user.save end before do @user = mock_model(User) @user_observer = UserObserver.instance end

Re: [rspec-users] Stubbing helper methods in controller specs when integrate_views is On

2009-11-26 Thread Matt Wynne
On 25 Nov 2009, at 16:02, Krasimir Angelov wrote: Hi all, I'm using rspec-caching-test-plugin to test caching (obviously) in my controller specs. Because views are also involved in caching integrate_views have to be turned On. The problem comes when mock is passed to a helper, for examle

Re: [rspec-users] undefined method `route_for

2009-11-26 Thread David Chelimsky
On Thu, Nov 26, 2009 at 1:21 AM, Amit Kulkarni wrote: > Amit Kulkarni wrote: > > Ok Fine.That sounds to be a good idea. > > Thanks > > Hi David, > Good news,My routing scenarios are working now. > I dont know how but it did.I was going to mail you the app but it is > working fine now. > > Excelle

Re: [rspec-users] Introductory recommendations?

2009-11-26 Thread Ashley Moran
On Nov 25, 2009, at 6:38 pm, Matt Wynne wrote: > +1 > > And have a coding dojo ASAP. It's much easier to learn when you're having fun. > > On 25 Nov 2009, at 18:07, Pat Maddox wrote: > >> Pair with them. How big's the team? Lots of ways you can do this. +2 +1 For the pairing, it's the most