Re: [rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread Ashley Moran
On 17 Jul 2010, at 4:37 PM, doug livesey wrote: > At the minute I'm chaining a load of should_receive calls on mock relation > objects I've found this can cause pain in so many ways: * Your tests end up coupled to the database structure (as that's how most associations are inferred) * You're a

Re: [rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread Wincent Colaiuta
El 17/07/2010, a las 17:37, doug livesey escribió: > Hi -- how are people speccing Rails 3 ActiveRecord queries? > At the minute I'm chaining a load of should_receive calls on mock relation > objects, but can't help thinking that there must be a more elegant way of > going about it. > Is there a b

Re: [rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread doug livesey
Interesting. I'll give that a bash, too. I must admit, I tend to use the first approach, but the second seems a little more true to the spirit of testing. I can imagine that it might get rather involved when setting up the database for even half-way complex queries, though. I'll see how I get on wi

Re: [rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 10:37 AM, doug livesey wrote: > Hi -- how are people speccing Rails 3 ActiveRecord queries? > At the minute I'm chaining a load of should_receive calls on mock relation > objects, but can't help thinking that there must be a more elegant way of > going about it. > Is there a

[rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread doug livesey
Hi -- how are people speccing Rails 3 ActiveRecord queries? At the minute I'm chaining a load of should_receive calls on mock relation objects, but can't help thinking that there must be a more elegant way of going about it. Is there a best practice for this, yet? Cheers, Doug. _