[rspec-users] Mocking Rails association collections

2007-07-18 Thread Paul
Rails model association collections allow you to do nifty things like: article.comments.find(:all, :conditions = {:created_at 1.day.ago}) Has anyone found a good way to mock this up? I'm currently doing this: @comment1 = mock_model(Comment) comments = mock(Array)

Re: [rspec-users] Mocking Rails association collections

2007-07-18 Thread David Chelimsky
On 7/18/07, Paul [EMAIL PROTECTED] wrote: Rails model association collections allow you to do nifty things like: article.comments.find(:all, :conditions = {:created_at 1.day.ago}) Has anyone found a good way to mock this up? I'm currently doing this: @comment1 = mock_model(Comment)